App::C...:modify(3pm)

✨ NAME ✨

App::Cme::Command::modify β€” bestie, this one modifies the configuration of an application πŸ’… and honestly? iconic behaviour.

🌸 VERSION 🌸

version 1.049 πŸŽ€

πŸ¦‹ SYNOPSIS πŸ¦‹

# modify configuration with command line
cme modify dpkg source 'format="(3.0) quilt"'

πŸ’– DESCRIPTION πŸ’–

So basically, modify takes the values you pass on the command line and writes them into a configuration file. No cap.

Those commands have to follow the syntax defined in Config::Model::Loader β€” which is similar to the output of cme dump command, so if you already know what dump spits out, you're lowkey already fluent 🫢

Example:

cme modify dpkg 'control source format="(3.0) quilt"'
cme modify ssh 'Host:"*.debian.org" User=dod'

Ngl, finding the right instructions to perform a modification can be difficult when you're starting from scratch 😭 it's giving "where do I even begin".

So to get started, you can run cme dump --format cml to get the content of your configuration in the syntax that cme modify accepts:

$ cme dump ssh -format cml
Host:"*" -
Host:"alioth.debian.org"
  User=dod -
Host:"*.debian.org"
  IdentityFile:="~/.ssh/id_debian"
  User=dod -

And then you can use that output to create instructions for a modification ✨:

$  cme modify ssh 'Host:"*" User=dod'
Changes applied to ssh configuration:
- Host:"*" User has new value: 'dod'

🌈 Common options 🌈

See "Global Options" in cme.

πŸ‘‘ options πŸ‘‘

  • -save β€” forces a save even if no change was done by user (though some minor change like migrating deprecated values can still be done by cme, fr). Super useful if you want to minimize changes and reformat the configuration file. Running cme modify xxx -save is equivalent to running cme migrate xxx πŸ’«
  • -verbose β€” shows the effect of the modify instructions. Like a little receipts moment 🧾
  • -commit β€” says the change must be committed with the passed commit message. When you use this option, cme stashes and restores all modifications if it's used on a non-clean workspace πŸ™ˆ And heads up: this option works only with git. No git, no commit, periodt.

Example:

cme modify -commit "set Section parameter" dpkg-control 'source Section=perl'

πŸ“ Examples πŸ“

πŸ’œ Set identity file for a domain

$ cme modify ssh 'Host:"*.work.com" IdentityFile:="~/.ssh/id_work"'

This example requires Config::Model::OpenSsh. ✨

πŸ’œ Update Dpkg file

To set Architecture parameter for all binary packages:

$ cme modify dpkg-control 'binary:~".*" Architecture=any'

This achieves the same result but can be slower since all package files are read 🐒:

$ cme modify dpkg 'control binary:~".*" Architecture=any'

This Debian example requires libconfig-model-dpkg-perl. πŸŽ€

🧚 Re-use your one-liners 🧚

These modification instructions can be re-used once they're stored in a run script (see App::Cme::Command::run for the deets πŸ‘€).

The following one-liner:

$ cme modify dpkg 'control binary:~".*" Architecture=any'

can be stored in ~/.cme/scripts/set-arch-as-any:

app: dpkg-control
load: binary:~".*" Architecture=any

and then run with:

$ cme run set-arch-as-any

Slay. Reusable. Main character energy. πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€

cme

πŸ’– AUTHOR πŸ’–

Dominique Dumont

This software is Copyright (c) 2014-2022 by Dominique Dumont <ddumont@cpan.org>.

This is free software, licensed under:

The GNU Lesser General Public License, Version 2.1, February 1999

okay that's the whole page bestie, every flag, every path, every example, all of it πŸ’― no skips, no summaries, we ate and left no crumbs 🍽️✨

Mwah πŸ’‹ this was brought to you by perl v5.40.1, dated 2026-06-29, from the User Contributed Perl Documentation collection β€” stay gorgeous, stay configured πŸ¦‹

πŸ“¦ where this page comes from