> ## Documentation Index
> Fetch the complete documentation index at: https://docs.codewire.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Platform Commands

> CLI commands for codewire.sh integration — workspaces, orgs, resources, and more.

# Platform Commands

Platform mode connects the CLI to codewire.sh for workspace management, org administration, and remote access. All platform commands require authentication via `cw setup` or `cw login`.

## Setup

### setup

Interactive wizard that configures platform mode. Walks you through server URL, login, org selection, resource selection, and GitHub connection.

```bash theme={null}
cw setup
```

Run this once to get started. Your configuration is saved to `~/.codewire/platform.json`.

## Authentication

### login

Authenticate with the Codewire platform.

```bash theme={null}
cw login
```

### logout

Sign out and clear stored credentials.

```bash theme={null}
cw logout
```

### whoami

Show the currently authenticated user.

```bash theme={null}
cw whoami
```

## Organizations

### orgs list

List all organizations you belong to.

```bash theme={null}
cw orgs list
```

### orgs create

Create a new organization.

```bash theme={null}
cw orgs create <name> --slug <slug>
```

### orgs delete

Delete an organization (owner only).

```bash theme={null}
cw orgs delete <slug>
```

### orgs invite

Invite a member to an organization.

```bash theme={null}
cw orgs invite <email> [--org <slug>] [--role <role>]
```

## Resources

### resources list

List resources in the current organization.

```bash theme={null}
cw resources list [--org <slug>]
```

### resources get

Show details for a specific resource.

```bash theme={null}
cw resources get <slug> [--org <slug>]
```

### resources create

Create a new resource.

```bash theme={null}
cw resources create <slug> --type <coder|relay> --plan <plan> [--org <slug>]
```

### resources delete

Delete a resource (owner or admin only).

```bash theme={null}
cw resources delete <slug> [--org <slug>]
```

## Workspaces

### launch

Create a workspace from a repository URL. AI analyzes the repo to detect language, framework, Docker configuration, and services.

```bash theme={null}
cw launch <repo-url|.> [--branch <branch>] [--resource <slug>] [--org <slug>]
```

Pass `.` to use the current directory's remote URL.

```bash theme={null}
cw launch github.com/your-org/your-repo
cw launch . --branch feature/new-api
```

### workspaces

List workspaces across your resources.

```bash theme={null}
cw workspaces [--org <slug>] [--resource <slug>]
```

### open

Open a workspace in your browser or connect via SSH.

```bash theme={null}
cw open [workspace]
```

### start / stop

Start or stop a workspace.

```bash theme={null}
cw start [workspace]
cw stop [workspace]
```

## Running Commands

### run (platform mode)

In platform mode, `cw run` SSHs into a workspace and runs a command in a persistent session.

```bash theme={null}
cw run [name] -- <command> [args...]
```

```bash theme={null}
cw run -- claude "fix the tests"
cw run worker --tag build -- make test
```

<Note>
  In standalone mode, `cw run` creates a local PTY session. In platform mode, it connects to a workspace first. See [Sessions](/cli/sessions) for standalone session management.
</Note>

## Secrets

### secrets

Manage organization secrets from the CLI.

```bash theme={null}
cw secrets [--org <slug>]
```

## Billing & Cost

### cost

View resource usage and cost estimates.

```bash theme={null}
cw cost [--org <slug>]
```

### billing

Open the billing portal.

```bash theme={null}
cw billing [--org <slug>]
```

## GitHub

### github login

Authenticate with GitHub for private repo access.

```bash theme={null}
cw github login
```

### github logout

Remove stored GitHub credentials.

```bash theme={null}
cw github logout
```

### github status

Check GitHub authentication status.

```bash theme={null}
cw github status
```

## Utilities

### update

Update the CLI to the latest version.

```bash theme={null}
cw update
```

### completion

Generate shell completions.

```bash theme={null}
cw completion <bash|zsh|fish>
```

```bash theme={null}
# Add to your shell profile
eval "$(cw completion zsh)"
```
