# How to Use the Archify CLI `guide` Command: Complete Tutorial

> Master the Archify CLI guide command with this tutorial. Quickly access formatting and language-aware help directly in your terminal, no browser needed. Learn to use Archify efficiently.

- Repository: [tt-a1i/archify](https://github.com/tt-a1i/archify)
- Tags: tutorial
- Published: 2026-09-06

---

**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`](https://github.com/tt-a1i/archify/blob/main/scripts/build-guide.mjs) to generate the guide output. This script performs three operations:

1. **Loads the template** – Reads [[`scripts/guide-template.html`](https://github.com/tt-a1i/archify/blob/main/scripts/guide-template.html)](https://github.com/tt-a1i/archify/blob/main/scripts/guide-template.html) as the structural foundation
2. **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)](https://github.com/tt-a1i/archify/blob/main/docs/assets/site-language.js)
3. **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)](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:

```bash
npm install -g archify

```

Verify the installation and locate the `guide` command:

```bash
archify --help

```

## Basic Usage of `archify guide`

Display the guide in your terminal using the default language (typically English):

```bash
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)](https://github.com/tt-a1i/archify/blob/main/docs/assets/site-language.js). Common supported codes include:

- `en` – English
- `zh` – Chinese

Example for Chinese:

```bash
archify guide --lang zh

```

If you omit `--lang`, the CLI falls back to the default language defined in [`site-language.js`](https://github.com/tt-a1i/archify/blob/main/site-language.js).

## Advanced Usage Patterns

### Paging Long Output

For guides that exceed your terminal height, pipe output to a pager:

```bash
archify guide | less

```

This preserves formatting and enables scrollback through the full guide content.

### Redirecting to File

Save the guide for offline reference:

```bash
archify guide > archify-reference.txt
archify guide --lang zh > archify-guide-zh.txt

```

### Getting Command Help

Display usage information specific to the `guide` subcommand:

```bash
archify guide --help

```

## Architecture and Source Files

Understanding the implementation helps troubleshoot issues and customize behavior.

| File | Purpose |
|------|---------|
| [`scripts/build-guide.mjs`](https://github.com/tt-a1i/archify/blob/main/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)](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)](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)](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:**

```bash

# Open guide while working in project directory

archify guide | less

```

**Team onboarding with localized documentation:**

```bash

# Share Chinese guide with international collaborators

archify guide --lang zh > onboarding-zh.txt

```

**CI/CD pipeline integration:**

```bash

# Verify CLI installation and guide availability

archify guide --help && echo "CLI ready"

```

## Troubleshooting

- **"Command not found"** – Ensure `archify` is installed globally or use `npx archify guide`
- **Unsupported language code** – Check available keys in [`docs/assets/site-language.js`](https://github.com/tt-a1i/archify/blob/main/docs/assets/site-language.js)
- **Formatting issues** – Verify your terminal supports the output encoding used by the HTML template renderer

## Summary

- **`archify guide`** renders documentation directly in your terminal without browser dependencies
- **`--lang <code>`** switches languages using strings from [`site-language.js`](https://github.com/tt-a1i/archify/blob/main/site-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`](https://github.com/tt-a1i/archify/blob/main/guide-template.html), and [`site-language.js`](https://github.com/tt-a1i/archify/blob/main/site-language.js)
- As implemented in `tt-a1i/archify`, the `guide` command 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)](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)](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)](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.