Overview

Nia CLI is a powerful command-line interface that allows you to interact with your codebase through AI-powered assistance. It enables you to chat with your code repositories, ask questions about your code, and get intelligent responses based on the analysis of your codebase.

Installation

pip install nia-cli

You can also use pipx for isolated installation:

pipx install nia-cli

Requires Python 3.7 or higher and an active internet connection.

Authentication

Before using Nia CLI, you need to authenticate with your API key:

# You'll be prompted to enter your API key
nia login

Or provide it directly:

nia login YOUR_API_KEY

Your API key is securely stored in your configuration file (~/.nia/config.json).

Managing Repositories

View all your indexed repositories:

nia list

This displays a table with repository IDs, names, branches, and indexing status.

Chatting with Your Code

1

Start a chat session

nia chat REPOSITORY_ID

If you’ve set a default repository:

nia chat
2

Ask questions

Once in a chat session, you can ask questions about your code:

> How is authentication implemented in this codebase?
> Where is the main entry point for the application?
> Explain the data flow for user registration
3

Multi-repository chat

Chat with multiple repositories at once:

nia chat REPOSITORY_ID --additional REPO_ID2,REPO_ID3

This combines knowledge from multiple codebases for more comprehensive answers.

4

Exit chat

Type ‘exit’ to end the chat session:

> exit

Command Reference

nia login [API_KEY]
command

Authenticate with Nia API

nia list
command

List all repositories

nia create OWNER/REPO
command

Index a GitHub repository

nia status [REPO_ID]
command

Check indexing status

nia select [REPO_ID]
command

Set default repository

nia chat [REPO_ID]
command

Chat with repository

Chat Tips

Contextual Questions

Ask about specific files, functions, or code patterns

Code Understanding

Request explanations of complex code sections or logic

Architectural Overview

Inquire about the overall structure and organization

Finding Code

Ask where certain functionality is implemented

Problem Solving

Describe bugs or issues for guidance

Navigation

Use ‘exit’ to end chat sessions

Configuration

The configuration file is stored at ~/.nia/config.json and contains:

{
  "api_key": "your-api-key",
  "default_repo": "repository-id",
  "user": {
    "name": "Your Name",
    "email": "your.email@example.com"
  },
  "model_preferences": {
    "default": "claude-3-sonnet"
  }
}

Advanced Usage

Troubleshooting

System Requirements

Operating System

Windows, macOS, or Linux

Memory

4GB RAM minimum (8GB recommended)

Storage

100MB for installation and configuration

Python

Version 3.7 or higher

Connectivity

Internet connection for API communication

Privacy and Security

Your code analysis happens on Nia’s secure servers. No code is stored permanently unless specifically requested.

  • API key is stored locally in ~/.nia/config.json
  • Communication with Nia servers is encrypted
  • No persistent storage of your code content

Support

If you encounter any issues or have questions:

  1. Check the troubleshooting section above
  2. Visit the Nia documentation
  3. Join our Discord community
  4. Contact support at arlan@nozomio.com