CME(1p)

🌸 CME(1p) 🌸

✨ NAME ✨

okay so bestie, meet cme β€” it Checks or edits configuration data with Config::Model. that's the whole vibe. πŸ’…


πŸŽ€ VERSION πŸŽ€

version 1.049 β€” yeah she's on 1.049, no cap.


πŸ¦‹ SYNOPSIS πŸ¦‹

# general synopsis
cme [ global_options ] command application [ options ] [ file ] [ modification_instructions ]

# edit dpkg config with GUI (and Config::Model::Dpkg)
cme edit dpkg

# read data from arbitrary file (for model read from alternate file)
cme check dpkg-copyright -file path/to/file

# edit /etc/sshd_config (with Config::Model::OpenSsh)
sudo cme edit sshd

# edit ~/.ssh/config (with Config::Model::OpenSsh)
cme edit ssh

# check validity
cme check dpkg

# check dpkg files, update deprecated parameters and save
cme migrate dpkg

# like migrate, but also apply all suggested fixes
cme fix dpkg

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

# likewise with an application that accepts file override
cme modify dpkg-copyright 'Comment="Modified with cme"'

# map conf data to a fuse file system
cme fusefs dpkg-copyright -d fuse_dir
$ ls -l fuse_dir/License/LGPL-2.1+/text
-rw-r--r-- 1 domi domi 391 30 Jan 19:00 fuse_dir/License/LGPL-2.1+/text
$ fusermount -u fuse_dir

# list all available applications (depends on your installation)
cme list

like, look at all those little one-liners. she's versatile, she's booked, she's thriving. ✨


πŸ’– DESCRIPTION πŸ’–

so depending on which command you pick (more on those below), the cme program uses Config::Model configuration descriptions to check, modify, or fix configuration files. that's the job. that's what she does. 🫢

the 3rd parameter is the application you wanna work on. most of the time, cme will just find the relevant configuration file(s) for you. that's the easy girlie case. for example:

sudo cme check popcon

but some applications β€” like the late multistrap β€” have no constraint on the configuration file name, so you have to hand the file name over yourself:

cme check multistrap raspbian.conf

or, same energy, different outfit:

cme check multistrap -file raspbian.conf

πŸ—‚οΈ Configuration file specification πŸ—‚οΈ

an application's configuration can show up in a few different forms, bestie. either:

  • several files (like debian packages),
  • a single file with a predefined file (popcon), or
  • a single file with an arbitrary file name (like the late multistrap).

when a file name is needed, you pass it as the 3rd command argument, i.e. cme command application file_name. this applies if the application requires a configuration file name to edit, or if the application allows configuration file override.


πŸ‘‘ Main commands πŸ‘‘

this section is the main-character lineup of commands that ship with cme. other Config::Model extensions can bring even more commands. run cme help to get the list of available commands on your system. πŸŽ€

πŸ“‹ list

show a list all applications where a model is available. this list depends on which Config::Model modules you have installed.

✏️ edit

edit a configuration. by default, a Tk GUI will be opened β€” if Config::Model::TkUI is installed. see App::Cme::Command::edit.

🐚 shell

edit the configuration with a shell like interface. see App::Cme::Command::shell.

βœ… check

checks the content of the configuration file of an application. see App::Cme::Command::check.

🚚 migrate

update deprecated parameters (old value are saved to new parameters) and save the new configuration. see App::Cme::Command::migrate.

πŸ› οΈ fix

migrate data and fix warnings. see App::Cme::Command::fix.

✍️ modify

modify a configuration file with the values passed on the command line. see App::Cme::Command::modify.

πŸ”„ update

update the content of the configuration file from external data. currently, only the dpkg-copyright model support update sub command. see App::Cme::Command::update.

search configuration data for a specific string. see App::Cme::Command::search.

🌈 fusefs

map the configuration file content to a FUSE virtual file system on a directory specified with option -fuse-dir. modifications done in the fuse file system are saved to the configuration file when the fusermount -u is run. πŸ¦‹


πŸ’… Global options πŸ’…

these ones work for all commands, so they're basically universal, periodt:

  • -create β€” perform the operation even if the configuration file is missing. this may be used to create a minimal configuration file. this option is disabled by default, because a missing configuration file often indicates an error during the installation of the application. ⚠️
  • -file β€” for model that support it, specify an alternate file to read and write the configuration.

you can use this option for model that require the target file to be specified (e.g. the late multitrap model). a file can also be specified with the 4th command argument. e.g. these 2 commands have the same effect:

cme check multistrap foo.conf
cme check multistrap -file foo.conf
  • -force-load β€” load file even if errors are found in data. bad data is discarded.
  • -canonical β€” write config data back using model order. by default, write items back using the order found in the configuration file. this feature is experimental and not supported by all backends. πŸ™ˆ
  • -backup β€” create a backup of configuration files before saving. by default, old will be appended to the backup file. i.e. foo.conf will be backed up as foo.conf.old. you can specify an alternate suffix. for instance -backup dpkg-old.
  • -save β€” force a save even if no change was done. useful to reformat the configuration file.
  • -strict β€” when set, cme will exit 1 if warnings are found during check (of left after fix). πŸ‘€
  • -verbose β€” show more information about what's going on. πŸ—£οΈ
  • -quiet β€” suppress all output except error messages. 🀫

πŸ”₯ Advanced options πŸ”₯

for when you're feeling spicy:

  • -model-dir β€” specify an alternate directory to find model files. mostly useful for tests.
  • -root-dir β€” specify a pseudo root directory to read and write the configuration files. (actual default directory and file names depends on the model (see -model option). for instance, if you specify ~/mytest, the /etc/ssh/sshd_config files will be written in ~/mytest/etc/ssh/ directory.)
  • -stack-trace β€” provides a full stack trace when exiting on error. πŸ’€
  • -try-app-as-model β€” when set, try to load a model using directly the application name specified as 3rd parameter on the command line. experimental. πŸ§ͺ

🧚 Embedding cme 🧚

you can use cme from another program by using the -ui simple option. this way you'll be able to send command on the standard input of cme and get the results from the standard output. it's giving pipe energy. 🫢


🌟 Logging 🌟

all Config::Model logging is now based on Log::Log4perl. logging can be configured in the following files:

  • ~/.log4config-model
  • /etc/log4config-model.conf

a sample of a .log4config-model is provided in contrib directory in Config::Model distribution of on github https://github.com/dod38fr/config-model/blob/master/contrib/log4config-model

without these files, the following Log4perl config is used:


 log4perl.rootLogger=WARN, Screen
 log4perl.logger.Model.Legacy = INFO, SimpleScreen
 log4perl.additivity.Model.Legacy = 0

 log4perl.appender.Screen        = Log::Log4perl::Appender::Screen
 log4perl.appender.Screen.stderr = 0
 log4perl.appender.Screen.layout = Log::Log4perl::Layout::PatternLayout
 log4perl.appender.Screen.layout.ConversionPattern = %M %m (line %L)%n

 log4perl.appender.SimpleScreen        = Log::Log4perl::Appender::Screen
 log4perl.appender.SimpleScreen.stderr = 0
 log4perl.appender.SimpleScreen.layout = Log::Log4perl::Layout::PatternLayout
 log4perl.appender.SimpleScreen.layout.ConversionPattern = %p: %m%n

 log4perl.oneMessagePerAppender = 1

Log4perl uses the following categories:

  • Anything
  • Anything::Change β€” trace change notification through configuration tree and instance.
  • Backend
  • Backend::Debian::Dpkg
  • Backend::Debian::Dpkg::Control
  • Backend::Debian::Dpkg::Copyright
  • Backend::Fstab
  • Backend::IniFile
  • Backend::PlainFile
  • Backend::ShellVar
  • Backend::Yaml
  • FuseUI
  • Instance
  • Loader
  • Model::Searcher
  • Tree::Element::CheckList
  • Tree::Element::Id
  • Tree::Element::Id::Hash
  • Tree::Element::Id::List
  • Tree::Element::Value
  • Tree::Element::Value::Dependency
  • Tree::Node
  • Tree::Node::Warped
  • ValueComputer
  • Warper
  • Iterator
  • Model

more categories will come. 🌱


🚦 EXIT CODE 🚦

cme exits 0 when no errors are found. exit 1 otherwise. simple as that, bestie. ✌️


πŸ’€ BUGS πŸ’€

not bugs like glitches, bugs like the known quirks. read carefully, she's warning you.

πŸ”€ Files may be re-ordered

cme imposes a specific ordering of the parameters of a configuration file. this ordering is derived from the documentation of the configuration, like ssh_confg. cme writes back files using this ordering.

so the diff between the original configuration files and the new version of the file may be more important than expected when cme is used the first time. 😭

πŸ™ˆ Comments may be dropped

comments are not supported in some applications (like the one that use YAML in configuration files). comments are dropped when using cme to edit or modify such files. for more details, see Available backend https://github.com/dod38fr/config-model/wiki/Available-models-and-backends#Available-backend page.

🐒 Configuration models can lag behind the target application

if a configuration model is not up-to-date, you'll get errors complaining about unknown parameters. in such a case, please file a bug on github https://github.com/dod38fr/cme-perl/issues or fix the model and send a pull request. you can see this example from OpenSsh https://github.com/dod38fr/config-model/wiki/New-parameter-for-openssh-example to learn how to fix a model. 🫢


πŸ”Ž FOR MORE INFORMATION πŸ”Ž

for more info, please check:


πŸ‘― CONTRIBUTORS πŸ‘―

in alphabetical order:

  • Ross Vandegrift

πŸ“¬ FEEDBACKS πŸ“¬

feedback from users are highly desired. if you find this module useful, please share your use cases, success stories with the author. she wants the lore, bestie. πŸ’Œ


🌈 SEE ALSO 🌈

Config::Model::Model, Config::Model::Instance, Config::Model::Node, Config::Model::HashId, Config::Model::ListId, Config::Model::WarpedNode, Config::Model::Value


πŸ‘‘ 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, you made it to the end πŸŽ‰ this was perl v5.40.1, dated 2026-06-29, and it's the CME(1p) manual β€” go forth and config, bestie, you've got this πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from