Migration update
qmims has been migrated from Amazon Q CLI to Kiro CLI. These docs reflect the current install, authentication, and command workflows.
Edit Command
Modify existing Markdown files using embedded qmims instructions
The edit command updates an existing Markdown file by asking Kiro CLI to read the file, interpret any embedded <!-- qmims: ... --> instructions, and write the revised content back to disk.
Syntax
qmims edit [file] [options]
Arguments
| Argument | Description | Default |
|---|---|---|
| file | Path to the Markdown file to edit | README.md |
Options
| Option | Alias | Description |
|---|---|---|
| --yes | -y | Automatically approve the Kiro tool-permission flow for the edit run |
| --dry-run | Show what would be done without making changes | |
| --verbose | -V | Show detailed output for debugging |
Examples
Edit README.md in the current directory:
qmims edit
Edit a specific Markdown file:
qmims edit docs/README.md
Automatically approve the Kiro run:
qmims edit --yes
Preview the workflow without changing files:
qmims edit --dry-run
Show detailed diagnostics:
qmims edit --verbose
How It Works
When you run qmims edit, the command follows this Kiro-backed flow:
- Resolve the target Markdown file, defaulting to
README.md - If the requested file does not exist, try discovering a fallback
README.mdin the same directory - Verify that Kiro CLI is installed and authenticated
- Invoke Kiro in documented non-interactive CLI mode
- Ask Kiro to read the Markdown file and find embedded qmims instructions
- Write the complete updated file back to the resolved target path
README fallback behavior
README.md in the target directory and use that as the actual edit target.Embedded Instruction Format
The edit command is designed to work with HTML comments that begin with the qmims prefix:
# Project Title <!-- qmims: Generate a concise overview based on the repository's main purpose. --> ## Features <!-- qmims: List the main user-facing capabilities of this project. --> ## Installation <!-- qmims: Update installation steps using the detected package manager and runtime requirements. -->
qmims asks Kiro to read the file, interpret all embedded instructions it finds, and update the Markdown accordingly.
Kiro Requirements
Before using edit, make sure Kiro CLI is ready:
kiro-cli whoami kiro-cli login kiro-cli doctor
For headless or CI environments, Kiro can also authenticate using KIRO_API_KEY.
# Linux / macOS export KIRO_API_KEY=your_api_key_here # Windows PowerShell $env:KIRO_API_KEY = "your_api_key_here"
Dry Run Output
In dry-run mode, qmims does not invoke Kiro. Instead, it shows the requested file, the resolved edit target, and the actions it would take.
qmims edit --dry-run
Tip
--dry-run before editing important documentation files so you can confirm the target path and workflow before making changes.When to Use edit
Good for targeted updates
- Refreshing installation steps
- Updating a features list
- Rewriting outdated usage examples
- Filling in placeholder sections
Less ideal for blank files
- Creating a brand-new README from nothing
- Choosing an initial structure for a new project
- Generating a template-based layout
- Bootstrapping docs without embedded instructions
For a brand-new README, start with qmims generate. Then use qmims edit for ongoing, instruction-driven maintenance.
For more on instruction syntax and writing effective prompts, see the Embedded Instructions section.