Use the CLI in scripts and CI
On this page
The CLI only asks a question in a terminal. Run from a script, CI or most AI agent tools, there's no terminal, and every question has an answer you can give up front.
Questions
| Question | With no terminal | Answer it up front |
|---|---|---|
| How much to do, such as one story map or the whole project | Takes the usual answer, and says so | --yes |
| Before overwriting or removing something, such as Apply changes? | Stops, and says to use --force | --force |
| A password | Stops, and says how to give one | See below |
--yes never stands in for --force, so it can't overwrite anything by accident. Some agent tools do run commands in a terminal, so have agents pass --yes every time.
A pull with changes to apply and no terminal:
storymaps pull ~ MVP: 1 card updated (status)storymap.yml was left as it is. Run again with --force to go ahead without being asked.
Passwords
Passwords are never options, as options end up in shell history and agent logs. They come from one of three places:
- 1Typed in a terminal.
- 2Remembered on this computer after
storymaps unlockorstorymaps project unlock --maps. Only a hash of the password is saved, never the password. Unlock once yourself, and an agent can push without ever seeing it. - 3
STORYMAPS_PASSWORD, an environment variable, for scripts and CI. Set it from the secrets of the pipeline.
With none of them, a command stops before it changes anything:
storymaps push ~ MVP: 1 card updated (status)This map is locked, and there's no terminal to type its password in. Nothing was pushed. Run storymaps unlock in a terminal first, or set STORYMAPS_PASSWORD for this command.
With the variable set:
STORYMAPS_PASSWORD="$MAP_PASSWORD" storymaps push ~ MVP: 1 card updated (status)Pushed to https://storymaps.io/abc12345
It works with every command that needs a password. For storymaps lock, it's the new password, so nothing is asked:
STORYMAPS_PASSWORD="$MAP_PASSWORD" storymaps lockLocked Coffee App.
Across a whole project, the variable is only tried on the project and the story maps locked with its password. A story map with its own password is never sent the wrong one, which would count against the limit on wrong passwords.
Lock a release from CI
A pipeline can lock a project, and its story maps, once a release is agreed:
STORYMAPS_PASSWORD="$RELEASE_PASSWORD" storymaps project lock --maps