# AI use cases for Star CLI (cryer/star-cli)

Repo: [cryer/star-cli](https://github.com/cryer/star-cli) | Use cases: 4 | Page: https://dedupedai.com/use-cases/cryer-star-cli/

A TypeScript command-line interface for AI agents that connects to several LLM providers, runs file, shell, and web tools behind a permission gate, and saves sessions.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Review working-tree changes and draft a commit message: https://dedupedai.com/use-cases/cryer-star-cli/review-and-commit-repo-changes/
- Plan a change read-only before any file is edited: https://dedupedai.com/use-cases/cryer-star-cli/plan-changes-read-only-before-edits/
- Call the agent from a shell script with print mode and JSON: https://dedupedai.com/use-cases/cryer-star-cli/script-agent-print-mode-ndjson/
- Resume a past agent session and export it to Markdown: https://dedupedai.com/use-cases/cryer-star-cli/resume-and-export-agent-sessions/

## How to review working-tree changes and draft a commit message with Star CLI

Repo: [cryer/star-cli](https://github.com/cryer/star-cli) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Use /diff to read colored changes, then /commit to draft a Conventional Commits message.

**Who it is for:** A developer with uncommitted edits in a git repository who wants a clear diff review and a commit message without writing it by hand.

**The problem:** Reviewing changes and writing a clean commit message takes attention, especially at the end of a long coding session.

**The outcome:** A reviewed diff and a Conventional Commits message ready to use in git.

### Steps

1. Install the CLI with `npm install -g @cryer/star-cli`.
2. Change into your git repository and start the REPL with `star`.
3. Type `/diff` to see the colored working-tree diff.
4. Type `/commit` to have the agent draft a Conventional Commits message from the changes.
5. Read the draft, edit it if needed, and run your own git commit.

### Prompt to paste into your agent

```text
Using the cryer/star-cli repo, run `star` inside <repo-path>, enter `/diff` and then `/commit`, and report the drafted commit message. Verify that the message follows the Conventional Commits format before anyone uses it.
```

### Caveat

The model features need a configured provider first, because /commit depends on the active model.

Dual-use notice: only use this on software, sites and systems you own or are authorized to test.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/cryer-star-cli/review-and-commit-repo-changes/

## How to plan a change read-only before any file is edited with Star CLI

Repo: [cryer/star-cli](https://github.com/cryer/star-cli) | Difficulty: Intermediate | Time: 45 minutes | Basis: From the README

Run plan mode so the agent researches without writing and waits for your approval.

**Who it is for:** A developer about to change code they do not know well, who wants to see the proposed plan before any file is touched.

**The problem:** An agent that edits right away can make wide changes before anyone has reviewed the approach.

**The outcome:** A written plan that you approve or reject before any edits happen.

### Steps

1. Install the CLI with `npm install -g @cryer/star-cli`.
2. Open `~/.star-cli/config.toml` and set `permissionMode = "plan"`. (inferred, check the README)
3. Start the REPL in the project folder with `star`.
4. Describe the change you want; the agent researches read-only and presents a plan.
5. Approve the plan to let edits proceed, or reject it and ask for changes.

### Prompt to paste into your agent

```text
Using the cryer/star-cli repo, set permissionMode to plan in ~/.star-cli/config.toml, run `star` in <project-dir> with the request <task>, and report the plan it produces. Verify that no files changed before approval by checking `git status`.
```

### Caveat

The README describes plan approval but not its exact on-screen flow, so confirm the approval step during your first run.

Dual-use notice: only use this on software, sites and systems you own or are authorized to test.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/cryer-star-cli/plan-changes-read-only-before-edits/

## How to call the agent from a shell script with print mode and JSON with Star CLI

Repo: [cryer/star-cli](https://github.com/cryer/star-cli) | Difficulty: Advanced | Time: 60 minutes | Basis: From the README

Run one prompt with star -p and --json, then parse the NDJSON output in a script.

**Who it is for:** A developer automating a repeated text or code task who needs the agent to run unattended inside a script.

**The problem:** The interactive REPL cannot run unattended, so a script needs a non-interactive entry point.

**The outcome:** A script that runs one prompt and reads machine-readable NDJSON lines.

### Steps

1. Install the CLI with `npm install -g @cryer/star-cli`.
2. Store your provider key in an environment variable or in ~/.star-cli/.env, using /connect in the REPL once.
3. Run `star -p "hi"` to confirm that print mode works.
4. Add `--json` to the same command, for example `star -p "<your prompt>" --json`, to get NDJSON output. (inferred, check the README)
5. Parse the output line by line in your script and handle each JSON object.

### Prompt to paste into your agent

```text
Using the cryer/star-cli repo, write a shell script that runs `star -p "<prompt>"` with --json and writes the output to <output-file>. Verify that every output line parses as valid JSON.
```

### Caveat

The README mentions --json for scripting but gives no example combined with -p, so test the exact flags before you rely on them.

Risk, credentials: Keep provider API keys in environment variables or ~/.star-cli/.env, never hard-coded in the script or committed to git.

Dual-use notice: only use this on software, sites and systems you own or are authorized to test.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/cryer-star-cli/script-agent-print-mode-ndjson/

## How to resume a past agent session and export it to Markdown with Star CLI

Repo: [cryer/star-cli](https://github.com/cryer/star-cli) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Reopen a saved session with /resume or star -r, then save it as Markdown with /export.

**Who it is for:** A developer who paused a multi-day coding task and needs to pick up the earlier context or share a written record.

**The problem:** Restarting an agent task from scratch loses the context of earlier decisions and tool results.

**The outcome:** A resumed conversation and a Markdown file that records the session.

### Steps

1. Install the CLI with `npm install -g @cryer/star-cli`.
2. Start the REPL in the project folder with `star`, work on a task, and exit.
3. Reopen the saved session with `star -r` or by typing `/resume` inside the REPL.
4. Type `/export` in the REPL to write the session to a Markdown file.

### Prompt to paste into your agent

```text
Using the cryer/star-cli repo, run `star -r` in <project-dir>, select the session for <task>, then run `/export`. Report the exported file path and verify that the file opens as Markdown.
```

### Caveat

The README does not say where /export saves its file, so check the output location during your first run.

Dual-use notice: only use this on software, sites and systems you own or are authorized to test.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/cryer-star-cli/resume-and-export-agent-sessions/
