# Quickstart

Before you begin, make sure you have Tabnine CLI installed:

[**Installation Guide**](https://docs.tabnine.com/main/getting-started/tabnine-cli/getting-started/installation) - Install Tabnine CLI on your system

If you've already installed Tabnine CLI, you're ready to go!

***

### Step 1: Start Tabnine CLI

Open your terminal and start Tabnine CLI:

```bash
tabnine
```

### Step 2: Authenticate

On first run, you may be prompted to authenticate. Follow the on-screen instructions to log in with your Tabnine account.

### Step 3: Your First Conversation

Once authenticated, you're ready to use Tabnine CLI!

#### Example 1: Ask a Question

```
> What is Tabnine CLI and how can it help me?
```

The AI will explain Tabnine CLI's capabilities.

#### Example 2: List Files

```
> What files are in the current directory?
```

Tabnine CLI will show you the directory structure.

#### Example 3: Read and Explain Code

```
> Read the package.json file and explain what this project does
```

The AI will read the file and provide an analysis.

#### Example 4: Write Code

```
> Create a simple Node.js HTTP server that responds with "Hello World"
```

Tabnine CLI will generate the code and can write it to a file if you confirm.

### Essential Commands

Tabnine CLI has built-in slash commands. Here are the most useful:

#### Get Help

```
> /help
```

Shows all available commands and keyboard shortcuts.

<figure><img src="https://3436682446-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY2qxVf5VTm3fmwP4B4Gx%2Fuploads%2FgINXnA8aTxJs3ZJ3xU6v%2Fslash%20help%20command.gif?alt=media&#x26;token=51661a42-6a47-4622-9a32-dd0aafe07269" alt=""><figcaption></figcaption></figure>

#### Change Model

```
> /model
```

Opens a dialog to select a different AI model.

<figure><img src="https://3436682446-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY2qxVf5VTm3fmwP4B4Gx%2Fuploads%2FLvVu1xglINWeShUX0ssl%2Fslash%20model%20command.gif?alt=media&#x26;token=15995cf4-bc40-401c-b0dc-4cc7b7a584ee" alt=""><figcaption></figcaption></figure>

#### Clear Conversation

```
> /clear
```

Clears the current conversation history.

#### View Settings

```
> /settings
```

Opens the settings dialog to configure Tabnine CLI.

#### Exit

Press `Ctrl+C` or type:

```
> /quit
```

### Working with Files

#### Read Files

Reference files using the `@` symbol:

```
> Explain what @src/index.ts does
```

The AI will automatically read and analyze the file.

#### Edit Files

```
> In @src/index.ts, add error handling to the main function
```

The AI will propose changes and ask for confirmation before modifying the file.

#### Create Files

```
> Create a new file README.md with documentation for this project
```

The AI will generate content and create the file (with your confirmation).

#### Search Files

```
> Find all TODO comments in @src/
```

The AI will search through your files.

### Using for Different Tasks

#### Code Review

```
> Review @src/auth.ts and suggest improvements
```

Get AI-powered feedback on your code.

#### Bug Fixing

```
> I'm getting a TypeError in @src/server.ts line 45. Help me fix it
```

Get help debugging issues.

#### Documentation

```
> Generate JSDoc comments for all functions in @src/utils.ts
```

Automatically create documentation.

#### Learning

```
> Explain how the authentication system works in this project
```

Understand your codebase better.

### Keyboard Shortcuts

Master these shortcuts for efficiency:

| Shortcut  | Action              |
| --------- | ------------------- |
| `Ctrl+C`  | Exit Tabnine CLI    |
| `Ctrl+L`  | Clear screen        |
| `↑` / `↓` | Navigate history    |
| `Ctrl+U`  | Clear current input |

Type `/help` to see all shortcuts.

### Non-Interactive Mode

For scripts and automation, use non-interactive mode:

{% hint style="info" %}
Non-interactive mode still requires authentication.

* Set `TABNINE_TOKEN` environment variable to a [Personal Access Token](https://docs.tabnine.com/main/administering-tabnine/managing-your-team/settings/access-tokens) generated in the Tabnine admin console.
* Or sign in once in interactive mode (`tabnine`) and authenticate with Tabnine using the OAuth flow.

If both are present, `TABNINE_TOKEN` takes precedence.
{% endhint %}

```bash
# Simple text output
tabnine -p "What are the main dependencies in package.json?"

# JSON output (for parsing)
tabnine -p "Analyze the project structure" --output-format json

# Process a file
cat myfile.js | tabnine -p "Review this code for security issues"
```

### Pro Tips

#### Be Specific

❌ "Review my code"\
✅ "Review @src/auth.ts for security vulnerabilities and error handling"

#### Use Context

Add project context with a `TABNINE.md` file in your project root:

```markdown
# Project Context

This is a TypeScript Node.js project for building web APIs.

## Key Conventions
- Use async/await for asynchronous code
- Add JSDoc comments to all exported functions
- Write unit tests in __tests__/ directories
```

#### Chain Tasks

```
> First, run the tests with `npm test`. If they pass, commit the changes with message "Add feature X"
```

#### Use Remote Code Search

```
> Using Remote Code Search, find all functions that handle user authentication
```

#### Get Coaching

```
> Based on coding best practices, review @src/api/ and suggest improvements
```

### Common Workflows

#### Morning Code Review

```
> Review the changes I made yesterday in @src/
```

#### Before Committing

```
> Check @src/ for:
> - Security issues
> - Missing error handling  
> - Code quality problems
```

#### Learning New Code

```
> I'm new to this codebase. Explain the overall architecture and where I should start
```

#### Refactoring

```
> Suggest refactoring opportunities in @src/services/ to improve maintainability
```

### Troubleshooting

#### Slow Response

If responses are slow:

1. Check your network connection
2. Try a different model with `/model`
3. Be more specific in your prompts
4. See [Troubleshooting Guide](https://docs.tabnine.com/main/getting-started/tabnine-cli/troubleshooting/common-issues)

#### Command Not Found

If you see "command not found: tabnine":

1. Verify Tabnine CLI is installed - see [**Installation Guide**](https://docs.tabnine.com/main/getting-started/tabnine-cli/getting-started/installation)
2. Check your PATH configuration
3. Try running with full path: `~/.local/bin/tabnine` (Linux/macOS)

### Next Steps

Now that you're familiar with the basics:

#### Learn More

* [**Installation Guide**](https://docs.tabnine.com/main/getting-started/tabnine-cli/getting-started/installation) - Installation and setup reference
* [**Commands Reference**](https://docs.tabnine.com/main/getting-started/tabnine-cli/features/commands) - All available commands
* [**Keyboard Shortcuts**](https://docs.tabnine.com/main/getting-started/tabnine-cli/features/keyboard-shortcuts) - Productivity tips
* [**Settings**](https://docs.tabnine.com/main/getting-started/tabnine-cli/features/settings) - Configure Tabnine CLI

#### Explore Powerful Features

* [**Remote Code Search**](https://docs.tabnine.com/main/getting-started/context-engine) - Search large codebases
* [**Coaching Guidelines** ](https://docs.tabnine.com/main/getting-started/context-engine/admin-console/coaching-guidelines-v)- Get best practices
* [**Built-in Tools**](https://docs.tabnine.com/main/getting-started/tabnine-cli/features/built-in-tools) - What tools are available
* [**Checkpointing**](https://docs.tabnine.com/main/getting-started/tabnine-cli/features/checkpointing) - Undo file changes

#### See Real Examples

* [**Code Review**](https://docs.tabnine.com/main/getting-started/tabnine-cli/examples/code-review) - Comprehensive review workflows

#### Get Help

* [**FAQ**](https://docs.tabnine.com/main/getting-started/tabnine-cli/troubleshooting/faq) - Common questions
* [**Troubleshooting**](https://docs.tabnine.com/main/getting-started/tabnine-cli/troubleshooting/common-issues) - Solve problems
* **In-App Help**: Type `/help` anytime

### Practice Exercise

{% stepper %}
{% step %}
**Start Tabnine CLI**

Start the CLI:

`tabnine`
{% endstep %}

{% step %}
**List files**

Ask:

`What files are in this directory?`
{% endstep %}

{% step %}
**Read a file**

Ask:

`Explain what @package.json contains`
{% endstep %}

{% step %}
**Get help**

Type:

`/help`
{% endstep %}

{% step %}
**Change model**

Type:

`/model` and explore options
{% endstep %}

{% step %}
**Ask about code**

Ask:

`What are the best practices for error handling?`
{% endstep %}
{% endstepper %}

Congratulations! You're now ready to use Tabnine CLI effectively. Happy coding! 🎉
