profile
CLI reference for the apothem profile command group.
Manage the shared Apothem profile.
profile is a command group with four subcommands: init, show, set, and edit.
The shared profile is the single source of truth that every harness adapter
materializes into its native configuration.
Synopsis
apothem profile init [--profile PATH] [--force]
[--quiet|-q] [--verbose|-v]
[--format plain|json] [--json] [--no-color]
apothem profile show [--profile PATH] [--quiet|-q] [--verbose|-v]
[--format plain|json] [--json] [--no-color]
apothem profile set KEY VALUE
[--profile PATH] [--quiet|-q] [--verbose|-v]
[--format plain|json] [--json] [--no-color]
apothem profile edit [--profile PATH] [--quiet|-q] [--verbose|-v]
[--format plain|json] [--json] [--no-color]Common options
Every subcommand accepts the shared options below.
| Option | Description |
|---|---|
--profile PATH | Path to the shared profile YAML (defaults to the standard profile location). |
--quiet, -q | Suppress informational output; only errors are emitted. |
--verbose, -v | Emit additional diagnostic output. |
--format plain|json | Output format (default: plain). |
--json | Shorthand for --format json. |
--no-color | Disable ANSI color codes in output. |
-h, --help | Show help and exit. |
Subcommands
profile init
Create a schema-valid minimal profile scaffold at
~/.config/apothem/profile.yaml or --profile PATH. Existing files are
preserved unless --force is supplied.
The scaffold's first line is a yaml-language-server modeline naming the
profile schema's $id,
https://apothem.ahmedgad.com/schemas/profile.schema.json. The site serves
the packaged schema at that address, so an editor with YAML language support
validates the profile while you edit it. Every packaged schema under
src/apothem/schemas/ is served the same way at
https://apothem.ahmedgad.com/schemas/<file>.
| Option | Description |
|---|---|
--force | Overwrite an existing profile scaffold. |
profile show
Display the validated, default-expanded shared profile. With --json the
document is the profile itself, led by schema_version: the profile schema
version the engine read it as (see the
JSON output contract).
profile set KEY VALUE
Set a key in the shared profile. KEY is a dotted path that descends into the
nested profile (identity.name, preferences.style, enforcement.sprints,
harnesses.<harness>.preferences.style); a single key with no dot sets a
top-level node. VALUE is stored as a literal string — bare words are not
coerced (no stays "no", 2024-01-01 and 1.0 stay strings) — except
true/false (the boolean enforcement flags) and explicit [...]/{...}
list/map input. The fully-assembled profile is validated against the schema
before writing; an invalid set is refused and the profile on disk is unchanged.
| Argument | Description |
|---|---|
KEY | Dotted path into the profile to set (required). |
VALUE | Literal value to assign; validated before writing (required). |
profile edit
Open the shared profile in the system editor.
Validation errors
Every command that reads the profile validates it against the packaged schema and reports every problem it finds in one pass, so one edit can fix them all:
- Plain output names the first problem in full (
Field,Reason,Fix, andOffending value (redacted): the input that failed, with secret-shaped values replaced by<redacted>; it is never a suggested replacement), then lists up to ten more underOther problems. - JSON output keeps the first problem in the
errorobject's top-level fields and adds anerrorsarray with every problem (code,field,reason,fix,safe_value). - Unknown keys echo only the unexpected key and its redacted value, not the whole profile.
- Managed-block markers. No key or text value may contain
<!-- BEGIN APOTHEM MANAGED BLOCK -->or<!-- END APOTHEM MANAGED BLOCK -->. Apothem writes those markers around the block it manages in instruction files, and profile text lands inside that block, so a marker in it would split the block. Each such field fails withprofile.managed_block_marker:fieldis its dotted path (for examplerules.2ormcp_servers.search.env.SEARCH_MODE) andreasonnames the marker. The value itself is never echoed (safe_valueisnull), since it may be a credential.
profile init (and every other command that scaffolds a profile) writes
schema_version: 1. A profile without schema_version is read as version 1.
Examples
apothem profile init
apothem profile init --profile ./profile.yaml --force --json
apothem profile show
apothem profile show --json
apothem profile set seriousness SHARED
apothem profile set rules '["Use fake placeholders in examples."]'
apothem profile editExit codes
| Code | Meaning |
|---|---|
| 0 | Success (or, for edit, the editor exited normally) |
| 1 | Profile missing, invalid, already exists without --force, or cannot be written |
| 64 | Usage error: an unknown option or command, or a missing or invalid option value. Under --json the error is a JSON envelope with code cli.usage. |
See also
- apothem install — materialize the profile into a harness
- apothem doctor — run system-wide install diagnostics