alphai 0.3.1
A CLI tool and Python package for the runalph.ai platform
Requires Python: >=3.10
Keywords: cli, api, data-science, alph

# alphai

A CLI tool and Python package for the [runalph.ai](https://runalph.ai) platform.

## Installation

```bash
pip install alphai
```

## Quick Start

1. **Authenticate** with your runalph.ai account:
   ```bash
   alphai login
   ```

2. **Start JupyterLab** connected to Alph:
   ```bash
   alphai jupyter lab
   ```
   
   This will prompt you to select an organization and project, then start JupyterLab locally with cloud sync.

3. **Manage notebooks**:
   ```bash
   alphai nb
   ```
   
   Opens an interactive browser to view, upload, download, and manage your notebooks.

## Commands

### Authentication

```bash
alphai login              # Browser-based login (recommended)
alphai login --token TOK  # Login with a token from runalph.ai/account/tokens
alphai login --force      # Force re-authentication
alphai logout             # Clear credentials
alphai status             # Show auth status and config
```

### Jupyter

Start JupyterLab or Jupyter Notebook locally, connected to your Alph workspace:

```bash
alphai jupyter lab                          # Interactive org/project selection
alphai jupyter lab --org my-org --project my-project
alphai jupyter lab --port 9999              # Custom port
alphai jupyter lab --local-only             # Skip cloud connection
alphai jupyter lab --quiet                  # Suppress Jupyter logs
```

```bash
alphai jupyter notebook                     # Classic notebook interface
```

### Notebooks

Manage notebooks from the command line:

```bash
alphai nb                                   # Interactive browser
alphai nb list                              # List notebooks
alphai nb list --org my-org                 # List in specific org
alphai nb view <notebook-id>                # View in terminal
alphai nb info <notebook-id>                # Show notebook info
alphai nb upload analysis.ipynb --org my-org
alphai nb download <notebook-id>
alphai nb publish <notebook-id>             # Make public
alphai nb unpublish <notebook-id>           # Make private
alphai nb delete <notebook-id>
alphai nb search "machine learning"
alphai nb fork <notebook-id> --org my-org
alphai nb tags <notebook-id> --add "python,ml"
```

### Organizations & Projects

```bash
alphai orgs list                # List your organizations
alphai orgs select <org-id>     # Set current org context

alphai projects list            # List projects
alphai projects select <id>     # Set current project context
```

### Configuration

```bash
alphai config show              # View current config
alphai config set key value     # Set a config value
alphai config reset             # Reset to defaults
```

## Environment Variables

- `ALPHAI_BEARER_TOKEN`: Bearer token for authentication
- `ALPHAI_API_URL`: Custom API base URL
- `ALPHAI_DEBUG`: Enable debug mode

## Global Options

```bash
alphai --debug <command>        # Enable debug logging
alphai --version                # Show version
alphai --help                   # Show help
```

## Learn More

- Documentation: [docs.runalph.ai](https://docs.runalph.ai)
- Website: [runalph.ai](https://runalph.ai)