Skip to content

amc-automation CLI Reference ​

Publishes AMC automations. Ships from @agent-mc/plugin-cli alongside amc-plugin, sharing its marketplace sign-in.

bash
npm install -g @agent-mc/plugin-cli
amc-automation --help

Exit codes ​

CodeMeaning
0Success, or warnings only
1An error-severity finding, a rejected publish, or a missing/unreadable recipe

Warnings never change the exit code. Only errors do.


amc-automation init <name> ​

Scaffolds <slug>.recipe.json plus a README.md. The result is a valid, publishable automation — init then validate is clean by construction.

OptionDefaultDescription
--description <text>The <name> automation.One-line description
--category <category>otherplanning, development, testing, devops, productivity, other
--forceoffOverwrite an existing recipe (and README)
bash
$ amc-automation init "Daily Digest" --category productivity
✓ Created daily-digest.recipe.json
ℹ Next: edit the steps, then run `amc-automation validate`.

An existing README.md is left alone unless you pass --force.


amc-automation validate [file] ​

Runs the local checks. [file] is optional when the directory holds exactly one *.recipe.json; with several, the CLI names them and asks you to pick.

OptionDefaultDescription
--checkoffAlso ask the marketplace for the authoritative verdict
--version <version>1.0.0The version to validate as, so --check can answer about version collisions
--category <category>otherThe category to validate as
--jsonoffEmit machine-readable findings

--check builds the same submission publish would send, so its verdict covers the two rejections that only the server can see: the automation id belonging to another developer, and this version already being published. Pass the same --version you intend to publish with, or the collision answer is about a version you were never going to submit.

bash
$ amc-automation validate

Local checks

✗ Step 2 has no prompt, so this automation cannot run. (step "summarize")
  → Add a non-empty "prompt". AMC blocks the run on an empty one.
⚠ description looks like a GitHub token.
  → Remove it before publishing — a published automation is public.

--json shape:

json
{
  "ok": false,
  "errors": [{ "severity": "error", "code": "empty-prompt", "message": "...", "fix": "..." }],
  "warnings": [],
  "info": [],
  "server": null
}

server is null when --check was not passed, when you are not signed in, or when the endpoint could not be reached. An unreachable server is not a validation failure.

Finding codes ​

CodeSeverityMeaning
recipe-fileerrorThe recipe file is missing, unreadable, not JSON, or ambiguous
bad-versionerror--version is not three dot-separated numbers
bad-categoryerror--category is not one of the six
missing-nameerrorNo name, or it is blank
name-too-longerrorOver 100 characters
no-stepserrorsteps missing or empty
bad-execution-modeerrorNot multi-session / same-session / parallel
bad-schema-versionerrorschemaVersion is not 1
malformed-steperrorAn entry in a steps array is not a step, so it would be dropped
unnamed-steperrorA step has no name
empty-prompterrorA step has no usable prompt
automation-id-too-shorterrorThe name slugs to fewer than 2 characters
automation-id-too-longerrorThe name slugs to more than 64 characters
automation-id-invaliderrorThe name slugs to something the marketplace will not accept
too-many-stepserrorMore than 200 steps
definition-too-largeerrorThe shareable part exceeds 256 KB
project-scopeerrorscope is project
sub-recipe-steperrorA step calls another recipe
script-steperrorA step runs a local script
prompt-fileerrorA step reads its prompt from disk
target-projecterrorA step is pinned to a local project
possible-secretwarningSomething key-shaped or an absolute user path
field-not-publishedinfoA top-level field the envelope does not carry
step-field-not-publishedinfoA step field the envelope does not carry

recipe-file, bad-version and bad-category are about the inputs rather than the recipe's contents, so they can be the only finding present. validate --json emits the same payload shape for them as for everything else — including when the file could not be loaded at all, so a CI step never has to tell empty stdout from a crashed process.


amc-automation publish [file] ​

Validates, authenticates, and uploads for review.

OptionDefaultDescription
--version <version>1.0.0Version for this submission
--category <category>otherAs per init
--changelog <text>emptyWhat changed in this version
--as <github-user>—Abort unless this account is signed in
--switch-accountoffSign out first and re-authenticate as a different account
-y, --yesoffSkip the identity confirmation prompt (for CI)
--dry-runoffEverything except the upload
--skip-validationoffPublish despite local errors
bash
$ amc-automation publish --changelog "first release"

Publishing as: octocat
? Publish this automation to the marketplace as "octocat"? › (y/N)
ℹ Publishing daily-digest v1.0.0 as octocat...
✓ Submitted for review (submission abc123)
ℹ Run `amc-automation status` to follow the review.

The account it publishes under ​

GitHub sign-in silently reuses whatever account your default browser is already logged into, so a publish can go out under an identity you never chose — and a published automation carries that name permanently. Every publish therefore confirms the account first, defaulting to no.

  • Wrong account? Answer n, then amc-automation publish --switch-account.
  • Automating it? -y skips the question, and --as <user> aborts outright if the signed-in account is not the one you named. Use both together in CI.

The sign-in is shared with amc-plugin, so switching the account here switches it for both.

The automation id ​

The id is derived from the recipe's name — "Daily Digest" becomes daily-digest. Rename the automation and you publish a different one, so choose the name before the first publish.

The marketplace requires that derived id to be 2–64 characters, so a single-character name and a name near the 100-character limit are both rejected. validate reports either one before you spend an upload.

In CI, pair --as with -y:

bash
amc-automation publish --as my-org-bot -y --changelog "$(git log -1 --pretty=%s)"

amc-automation status ​

Shows the review state of your submissions, filtered to the automation in the current directory.

OptionDescription
--allEvery submission, not just this directory's
bash
$ amc-automation status

Submissions

daily-digest v1.0.0 Pending review

Statuses are Pending review, Published, and Changes requested; reviewer notes print underneath when present.

Only your own submissions are listed, most recent 50 first. When the marketplace refuses the request it prints the server's own reason; "Could not reach the marketplace" means exactly that and nothing else.


Environment ​

VariablePurpose
AMC_MARKETPLACE_API_URLOverride the marketplace API base URL (default https://amcback.jls.dev/marketplace)
AMC_MARKETPLACE_AUTH_URLOverride the sign-in page

The stored token lives at ~/.amc/marketplace-token and is shared with amc-plugin — sign in once, use both. amc-plugin logout clears it.

AMC Plugin SDK