Skip to content
Build with Mammoth › CLI reference: open the docs menu

mammoth snippet

Generated from mammoth-cli 2.4.2, released 2026-11-02: mammoth schema list, mammoth capability list and the CLI's own --help. Do not edit by hand; run npm run docs:capabilities.

Manage reusable snippets. 8 commands.

Every command also takes the global flags (--output, --yes, --confirm, --dry-run, --input, --profile, ...), which are not repeated below. --input takes a JSON or YAML document of the input fields; mammoth schema get COMMAND_ID prints a command's full input schema.

Confirmation. Commands marked --yes --confirm TARGET or --yes always need those flags, even at a terminal: they never prompt. Commands marked "--yes or prompt" ask at an interactive terminal (table output, no --no-input) and otherwise need --yes. --dry-run skips confirmation and sends nothing.

Summary

CommandWhat it doesEffectConfirmation
snippet createCreate a snippet. Name comes from a positional or the 'name' field.Benign mutation—
snippet deleteDelete one snippet by id. Prompt or '--yes' required.Destructive--yes or prompt
snippet dependenciesReport dependencies for one snippet by id.Read—
snippet duplicateDuplicate one snippet by id.Benign mutation—
snippet getGet one snippet by id.Read—
snippet listList snippets in the active project.Read—
snippet rerunRerun one snippet by id.Benign mutation—
snippet updateUpdate a snippet's fields. Snippet id is positional; fields come from '--input'.Benign mutation—

snippet commands

mammoth snippet create

Create a snippet. Name comes from a positional or the 'name' field.

mammoth snippet create 'Revenue report' --input '{"code": "SELECT * FROM orders", "language": "sql"}'
NamePassed asRequiredDefaultTypeNotes
NAMEpositionalno—strName of the new snippet; or pass it via the 'name' input field. Or the name input field.
name--input fieldno—str
code--input fieldyes—str
language--input fieldyes—str
description--input fieldno—str
group_id--input fieldno—int
scope--input fieldnoprojectstr
  • Effect: Benign mutation, scope project · Confirmation: none
  • Id: snippet.create · Result: SnippetCreateResult · Backed by: SDK mammoth.api.snippets.SnippetsAPI.create, API POST /workspaces/{workspace_id}/snippets (CreateSnippet)

mammoth snippet delete

Delete one snippet by id. Prompt or '--yes' required.

mammoth snippet delete 123 --yes
NamePassed asRequiredDefaultTypeNotes
SNIPPET_IDpositionalyes—intID of the snippet.
  • Effect: Destructive, scope project · Confirmation: --yes, or answer the prompt at an interactive terminal
  • Preconditions: Required inputs: SNIPPET_ID.
  • Id: snippet.delete · Result: SnippetDeleteResult · Backed by: SDK mammoth.api.snippets.SnippetsAPI.delete, API DELETE /workspaces/{workspace_id}/snippets/{snippet_id} (DeleteSnippet)

mammoth snippet dependencies

Report dependencies for one snippet by id.

mammoth snippet dependencies 123
NamePassed asRequiredDefaultTypeNotes
SNIPPET_IDpositionalyes—intID of the snippet.
  • Effect: Read, scope project · Confirmation: none
  • Preconditions: Required inputs: SNIPPET_ID.
  • Id: snippet.dependencies · Result: SnippetDependenciesResult · Backed by: SDK mammoth.api.snippets.SnippetsAPI.dependencies, API GET /workspaces/{workspace_id}/snippets/{snippet_id}/dependencies (GetSnippetDependencies)

mammoth snippet duplicate

Duplicate one snippet by id.

mammoth snippet duplicate 123
NamePassed asRequiredDefaultTypeNotes
SNIPPET_IDpositionalyes—intID of the snippet.
  • Effect: Benign mutation, scope project · Confirmation: none
  • Preconditions: Required inputs: SNIPPET_ID.
  • Id: snippet.duplicate · Result: SnippetDuplicateResult · Backed by: SDK mammoth.api.snippets.SnippetsAPI.duplicate, API POST /workspaces/{workspace_id}/snippets/{snippet_id}/duplicate (DuplicateSnippet)

mammoth snippet get

Get one snippet by id.

mammoth snippet get 123
NamePassed asRequiredDefaultTypeNotes
SNIPPET_IDpositionalyes—intID of the snippet.
  • Effect: Read, scope project · Confirmation: none
  • Preconditions: Required inputs: SNIPPET_ID.
  • Id: snippet.get · Result: SnippetGetResult · Backed by: SDK mammoth.api.snippets.SnippetsAPI.get, API GET /workspaces/{workspace_id}/snippets/{snippet_id} (GetSnippetDetail)

mammoth snippet list

List snippets in the active project.

mammoth snippet list
NamePassed asRequiredDefaultTypeNotes
limit--input fieldno—int
offset--input fieldno—int
search--input fieldno—str
group_id--input fieldno—int
sort--input fieldno—str
  • Effect: Read, scope project · Confirmation: none · Pages: single_page
  • Id: snippet.list · Result: SnippetListResult · Backed by: SDK mammoth.api.snippets.SnippetsAPI.list, API GET /workspaces/{workspace_id}/snippets (ListSnippets)

mammoth snippet rerun

Rerun one snippet by id.

mammoth snippet rerun 123
NamePassed asRequiredDefaultTypeNotes
SNIPPET_IDpositionalyes—intID of the snippet.
  • Effect: Benign mutation, scope project · Confirmation: none
  • Preconditions: Required inputs: SNIPPET_ID.
  • Id: snippet.rerun · Result: SnippetRerunResult · Backed by: SDK mammoth.api.snippets.SnippetsAPI.rerun, API POST /workspaces/{workspace_id}/snippets/{snippet_id}/rerun (RerunSnippet)

mammoth snippet update

Update a snippet's fields. Snippet id is positional; fields come from '--input'.

mammoth snippet update 123
NamePassed asRequiredDefaultTypeNotes
SNIPPET_IDpositionalyes—intID of the snippet.
name--input fieldno—str
code--input fieldno—str
language--input fieldno—str
description--input fieldno—str
group_id--input fieldno—int
  • Effect: Benign mutation, scope project · Confirmation: none
  • Preconditions: Required inputs: SNIPPET_ID.
  • Id: snippet.update · Result: SnippetUpdateResult · Backed by: SDK mammoth.api.snippets.SnippetsAPI.update, API PATCH /workspaces/{workspace_id}/snippets/{snippet_id} (UpdateSnippet)

Report an issue · support@mammoth.io