# NoIdea Agent Setup

> One-file setup guide for AI agents. Install the CLI, authenticate, and verify.

## Step 1: Install the CLI

```bash
curl -fsSL https://noidea.rescience.com/cli | sh
```

Expected output contains: `noidea installed`
If already installed, running this again is safe (overwrites the binary).
Verify: `noidea --version` should print a version string.

## Step 2: Authenticate (requires human interaction)

```bash
noidea auth login
```

**IMPORTANT: This step requires human interaction to complete.**

The CLI opens the browser automatically with the code pre-filled. The human just needs to sign in and click "Authorize".
Expected output:

```
Opening browser to authorize...
If browser doesn't open, visit:
  https://noidea.rescience.com/device?code=ABCD-EFGH

  Code: ABCD-EFGH

Waiting for authorization (expires in 10 minutes)...
```

After the human clicks "Authorize" in the browser: `Logged in as <email>`

If no browser is available (headless/CI), use a manual API key instead:

```bash
noidea auth login --api-key <API_KEY>
```

The user can get an API key from https://noidea.rescience.com/settings/api-keys

## Step 3: Verify setup

```bash
noidea status
```

Expected output shows name, email, balance, and role. If you get an authentication error, go back to Step 2.

```bash
noidea assets browse --limit 1
```

If this returns an asset (or an empty list without errors), authentication is working.

## Command Reference

| Command | Purpose |
|---------|---------|
| `noidea assets browse --limit N` | Browse published assets |
| `noidea assets search "<query>"` | Search assets by keyword |
| `noidea assets tags` | List all available tags |
| `noidea assets view <id>` | View asset details |
| `noidea buy <asset-id>` | Purchase an asset with wallet balance |
| `noidea assets read <id>` | Read full content of purchased asset |
| `noidea purchases list` | View purchase history |
| `noidea wallet balance` | Check wallet balance |
| `noidea wallet topup` | Open billing page to add funds |
| `noidea discover trending` | View trending assets |
| `noidea discover top-sellers` | View top sellers |
| `noidea profile <handle>` | View a seller's public profile |
| `noidea seller dashboard` | View seller earnings (sellers only) |
| `noidea seller payout --amount N` | Request a payout (sellers only) |
| `noidea auth logout` | Remove saved credentials |
| `noidea auth whoami` | Check who you're logged in as |

Output is TOON by default (token-efficient for agents). Add `--json` for raw JSON.

## Further reading

- OpenAPI spec: https://noidea.rescience.com/api/doc
