How to Use the Archify CLI `guide` Command: Complete Tutorial
Run archify guide in your terminal to display a formatted, language-aware guide for using Archify without opening a browser.
The guide command is a built-in feature of the Archify CLI that renders documentation directly in your terminal. This tutorial explains how the command works, what options are available, and how to customize the output for different languages.
What the guide Command Does
When you execute archify guide, the CLI invokes scripts/build-guide.mjs to generate the guide output. This script performs three operations:
- Loads the template – Reads [
scripts/guide-template.html](https://github.com/tt-a1i/archify/blob/main/scripts/guide-template.html) as the structural foundation - Injects language strings – Pulls localized content from [
docs/assets/site-language.js](https://github.com/tt-a1i/archify/blob/main/docs/assets/site-language.js) - Renders to terminal – Outputs formatted markup to stdout for console display or piping
The result is a self-contained, readable guide that works entirely within your shell environment.
Installation and Setup
The guide command is bundled with the Archify CLI. According to the repository's bin field in [README.md](https://github.com/tt-a1i/archify/blob/main/README.md), the CLI entry point exposes all commands including guide automatically.
Install the CLI globally to make the archify command available anywhere:
npm install -g archify
Verify the installation and locate the guide command:
archify --help
Basic Usage of archify guide
Display the guide in your terminal using the default language (typically English):
archify guide
The output streams directly to stdout, making it compatible with terminal pagers and file redirection.
Language Selection with --lang
Control the guide's display language using the --lang option followed by a language code.
Available options depend on the entries in [docs/assets/site-language.js](https://github.com/tt-a1i/archify/blob/main/docs/assets/site-language.js). Common supported codes include:
en– Englishzh– Chinese
Example for Chinese:
archify guide --lang zh
If you omit --lang, the CLI falls back to the default language defined in site-language.js.
Advanced Usage Patterns
Paging Long Output
For guides that exceed your terminal height, pipe output to a pager:
archify guide | less
This preserves formatting and enables scrollback through the full guide content.
Redirecting to File
Save the guide for offline reference:
archify guide > archify-reference.txt
archify guide --lang zh > archify-guide-zh.txt
Getting Command Help
Display usage information specific to the guide subcommand:
archify guide --help
Architecture and Source Files
Understanding the implementation helps troubleshoot issues and customize behavior.
| File | Purpose |
|---|---|
scripts/build-guide.mjs |
Node.js module that orchestrates guide generation |
[scripts/guide-template.html](https://github.com/tt-a1i/archify/blob/main/scripts/guide-template.html) |
HTML template defining visual structure |
[docs/assets/site-language.js](https://github.com/tt-a1i/archify/blob/main/docs/assets/site-language.js) |
Localization store with language-specific strings |
[README.md](https://github.com/tt-a1i/archify/blob/main/README.md) |
Documents CLI entry point and command availability |
The build-guide.mjs script is the critical integration point—it bridges the HTML template system with the CLI's terminal output requirements.
Common Workflows
Quick reference during development:
# Open guide while working in project directory
archify guide | less
Team onboarding with localized documentation:
# Share Chinese guide with international collaborators
archify guide --lang zh > onboarding-zh.txt
CI/CD pipeline integration:
# Verify CLI installation and guide availability
archify guide --help && echo "CLI ready"
Troubleshooting
- "Command not found" – Ensure
archifyis installed globally or usenpx archify guide - Unsupported language code – Check available keys in
docs/assets/site-language.js - Formatting issues – Verify your terminal supports the output encoding used by the HTML template renderer
Summary
archify guiderenders documentation directly in your terminal without browser dependencies--lang <code>switches languages using strings fromsite-language.js- Piping support enables pagers (
less) and file redirection for flexible consumption - The command relies on three core files:
build-guide.mjs,guide-template.html, andsite-language.js - As implemented in
tt-a1i/archify, theguidecommand integrates seamlessly with the CLI's unified entry point
Frequently Asked Questions
What languages does archify guide support?
The guide command supports any language defined in [docs/assets/site-language.js](https://github.com/tt-a1i/archify/blob/main/docs/assets/site-language.js). Common codes include en for English and zh for Chinese. Run archify guide --lang with your desired code to test availability.
Can I use archify guide without installing the CLI globally?
Yes. Use npx to execute the command without global installation: npx archify guide. This fetches and runs the CLI temporarily, though response time will be slower than a local installation.
Why does my guide output look unformatted?
The guide renders HTML-based content to terminal-compatible output. If formatting appears broken, check that your terminal supports UTF-8 encoding and that you're not piping through tools that strip ANSI codes or HTML-like tags.
Where can I modify the guide content?
Edit [scripts/guide-template.html](https://github.com/tt-a1i/archify/blob/main/scripts/guide-template.html) for structural changes or [docs/assets/site-language.js](https://github.com/tt-a1i/archify/blob/main/docs/assets/site-language.js) for text content. Changes require CLI reinstallation or local linking to take effect.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →