Saphan StudioDocs
Reference/Commands

saphan prompt

Manages the prompt library: reusable prompt documents that a person picks and copies into a model.

Manages the prompt library: reusable prompt documents that a person picks and copies into a model. Bodies are kept byte for byte (nothing reformats or renders them), categories, platforms, roles and languages come from closed lists that are printed when a value is refused, and a prompt's inputs are derived from the <placeholders> in its body. The library is a directory in the workspace unless --db-url points it at a CouchDB database. add and edit always save a new document and nothing is deleted, so earlier versions stay available; only import --replace overwrites a stored document. Adding and editing need an identity (--actor, SAPHAN_ACTOR or your configuration).

saphan prompt

saphan prompt add

Adds one prompt, either a whole JSON document (--file) or a new prompt built from --title and --body-file (giving both forms is refused). Fields the document omits are derived and filled in, any field that contradicts the body is refused, and an ID the store already holds is refused rather than overwritten.

saphan prompt add
flagtypedefaultwhat it does
--body-filestringThe file holding the new prompt's body, read verbatim; - reads standard input.
--categorystringSliceA category from the closed list; repeatable.
--code-langstringSliceA programming language; repeatable, any value.
--filestringA complete prompt document, in JSON, to add.
--langstringThe prompt's language: en, pl or th.
--platformstringSliceA platform from the closed list; repeatable.
--rolestringSliceA role the prompt is offered to, from the closed list (advisor, master, scribe, any); repeatable.
--tagstringSliceA free-form tag; repeatable.
--techstringSliceA technology or framework; repeatable, any value.
--titlestringThe title of a new prompt.

saphan prompt edit

Saves changes to a prompt as a new document; the prompt you named is left exactly as it was. Editing your own prompt continues its version chain; editing a built-in prompt starts your own copy at version 1, which no later upgrade can overwrite. Inputs and the body digest are recomputed from the new body.

saphan prompt edit <id>
flagtypedefaultwhat it does
--body-filestringThe file holding the new body, read verbatim; - reads standard input.
--categorystringSliceReplace the categories; repeatable.
--langstringThe new language: en, pl or th.
--platformstringSliceReplace the platforms; repeatable.
--rolestringSliceReplace the roles; repeatable.
--tagstringSliceReplace the tags; repeatable.
--titlestringThe new title.

saphan prompt export

Writes every prompt, or only the named IDs, to a directory as one canonical <id>.json file each, the same format the built-in set ships in, so moving a library between machines is copying files. A file of the same name already in the directory is overwritten; a named ID the store does not hold makes the command fail after writing the rest. Export, import and export again produce identical bytes.

saphan prompt export [<id>...]
flagtypedefaultwhat it does
--tostringThe directory to write into, created if missing. Required.

saphan prompt import

Reads prompt documents from files or directories into the store in two passes, and the first writes nothing. An invalid document, a duplicate ID in the batch, a store that could not be checked, or a set that would leave a version chain with no latest version stops the import before anything is written, and so, without --replace, does an ID the store already holds. If the store fails part-way through writing, the documents already written stay written and are named.

saphan prompt import <path>...
flagtypedefaultwhat it does
--replaceboolfalse⚠ Overwrite documents whose IDs the store already holds, including ones this binary cannot read; the overwritten document is not kept. The CouchDB store does not accept in-place replacement, so there it is refused by name.

saphan prompt list

Lists the latest version of each prompt (ID, scope, language, categories, version and title) and how many older versions stand behind it. The header shows how many documents the store holds beside how many the filters show, so an empty result and an empty library can be told apart.

saphan prompt list
flagtypedefaultwhat it does
--categorystringShow only one category: development, analysis, research, debug, bugfix, planning, design, review, testing, security, docs, saphan or other.
--domainstringShow only one domain: coding, devops, qa or security.
--kindstringShow only one kind: completion, template or skill.
--langstringShow only one language: en, pl or th.
--platformstringShow only one platform: android, ios, frontend, backend, cli, infra, data or any.
--rolestringShow only prompts offered to this role: advisor, master, scribe or any.
--scopestringShow only one scope: builtin, user or team.
--searchstringShow only prompts whose title, body or tags contain this text.
--tagstringShow only prompts carrying this tag.
--versionsboolfalseShow every version, marking the superseded ones, instead of only the latest of each chain.

saphan prompt seed

Writes the built-in prompts carried in this binary into the configured CouchDB store as scope builtin: missing ones are created and identical ones left alone; a prompt that is not built-in is never overwritten and nothing is deleted. ⚠ Replacing an older built-in is currently refused, because the store accepts each document only once. If CouchDB is not configured the command says so and exits 0, and prompt list keeps reading the built-in set from the binary.

saphan prompt seed

saphan prompt show

Prints one prompt as canonical JSON, exactly as stored.

saphan prompt show <id>
flagtypedefaultwhat it does
--bodyboolfalsePrint only the body's bytes, with nothing added: the form to pipe to a clipboard.

saphan prompt validate

Validates prompt documents in files or directories against the schema and the closed lists, reporting every broken document rather than stopping at the first. Each row also says whether re-encoding reproduces the file byte for byte; that is reported, not enforced.

saphan prompt validate <path>...
flagtypedefaultwhat it does
--quietboolfalsePrint only the refusals and the totals.

Global options apply to every command — see Every command.

On this page