Using Zcrafter
Slash Commands

Slash Commands

Slash commands are special commands in Interactive Mode that start with a forward slash. They perform specific actions like setting the API key, clearing history, or getting help.

What are Slash Commands?

Slash commands are shortcuts for common actions in Zcrafter. Instead of typing a natural language question, you type a command that starts with a forward slash.

Example:

/help

This displays help information without needing to ask "Can you help me?" or "Show me help."

Available Slash Commands

/api key

Set your OpenRouter API key for the current session.

Usage:

/api key sk-or-...

What it does:

  • Stores the API key in memory for this session
  • Used by the CLI to contact the AI provider

When to use:

  • First time using Zcrafter
  • When changing keys

/model

Select the model for responses.

Usage:

/model openai/gpt-4o

What it does:

  • Sets the active model

/help

Display help information and available commands.

Usage:

/help

What it does:

  • Shows list of available slash commands
  • Displays usage information
  • Provides helpful tips

Output includes:

  • All available slash commands
  • Brief description of each command
  • Examples of natural language commands

Example:

/help

Zcrafter Help

Slash Commands:
  /api key  - Set session API key
  /model    - Set active model
  /help     - Show this help
  /clear    - Clear conversation history
  /exit     - Exit Zcrafter

Natural Language:
  Just type your question in plain English!
  Example: "What is a S0C7 error?"

/clear

Clear the conversation history in the current session.

Usage:

/clear

What it does:

  • Removes all previous messages from the current session
  • Clears the screen
  • Starts fresh conversation
  • Does not affect authentication

When to use:

  • Starting a new topic
  • Screen is too cluttered
  • Starting a different task

Example:

/clear
Conversation history cleared.

/exit

Exit Zcrafter and return to your terminal.

Usage:

/exit

Also works:

  • /quit
  • Ctrl+C (press twice)

What it does:

  • Closes the Interactive Mode
  • Returns you to your shell prompt
  • Does not log you out (token remains valid)

Example:

/exit
Thank you for using Zcrafter!

How to Use Slash Commands

Basic Usage

  1. Type the forward slash
  2. Type the command name
  3. Press Enter
/help

Commands are Case-Insensitive

These all work the same:

/help
/HELP
/Help

No Spaces After Slash

Correct:

/login

Incorrect:

/ login     (won't work)

Slash Commands vs Natural Language

AspectSlash CommandsNatural Language
Format/commandPlain English
PurposeSpecific actionsQuestions, analysis, help
Examples/login, /help"Analyze this code", "What is VSAM?"
ResponseImmediate actionAI-generated answer
Best forQuick actionsLearning, debugging

When to use slash commands:

  • Logging in/out
  • Clearing screen
  • Getting help
  • Exiting the program

When to use natural language:

  • Asking questions
  • Analyzing code
  • Learning concepts
  • Debugging issues

Command Reference Table

CommandDescriptionExample Output
/api keySet session API key"✓ API key set"
/modelSet model"Model set to openai/gpt-4o"
/helpShow available commandsList of commands and usage
/clearClear conversation history"Conversation history cleared"
/exitExit ZcrafterReturns to shell prompt

Common Use Cases

Starting a New Session

/clear
What is a S0C7 error?

Set API key and ask a question

/api key sk-or-...
Explain what COBOL is

Getting Unstuck

/help
[Review available commands]
/clear
[Start fresh]

Ending Your Session

/exit

Keyboard Shortcuts

While not technically slash commands, these keyboard shortcuts are useful in Interactive Mode:

ShortcutAction
Ctrl+C (twice)Exit Zcrafter
Up ArrowPrevious command in history
Down ArrowNext command in history

Troubleshooting Slash Commands

Command Not Recognized

If you see "Command not recognized":

Check spelling:

/hlep          (typo)
/help          (correct)

Remove extra spaces:

/ login        (space after slash)
/login         (correct)

/login Not Opening Browser

If /login doesn't open your browser:

  1. Check your default browser is set
  2. Copy the URL shown in terminal and open manually
  3. Check your firewall settings

/clear Not Working

If /clear doesn't clear the screen, try using Ctrl+L as an alternative (works in some terminals).

/exit Hangs

If /exit doesn't work:

  1. Try /quit
  2. Press Ctrl+C twice

Tips

  1. Use /help when stuck: If you forget available commands, type /help
  2. Clear before sensitive work: Use /clear before pasting sensitive information
  3. Exit cleanly: Use /exit instead of forcing terminal close

Next Steps