# Get started with the CLI

Source: https://projectfeed.app/docs/cli/getting-started

Install pf, authenticate, select a workspace, and run the first command.

## Install pf

Install globally with npm. Node.js 22.12 or newer is required.

Shell

```
npm install -g pfeed-cli
```

Or run a command directly with npx:

Shell

```
npx pfeed-cli projects list
```

## Quick start

1.  1.
    
    ### Install
    
    Run `npm install -g pfeed-cli`.
    
2.  2.
    
    ### Sign in
    
    Create an API key, then run `pf auth login` and paste it at the prompt. The prompt keeps the key out of shell history. To skip the prompt, set `PROJECT_FEED_API_KEY` or pipe the key to `pf auth login --with-token`. In an interactive terminal, `pf quickstart` runs a guided setup. See [Authentication](https://projectfeed.app/docs/cli/configuration/authentication).
    
3.  3.
    
    ### Choose a workspace
    
    A workspace API key is tied to one workspace. A personal API token works across your workspaces, so commands need a workspace target. Pass `--workspace <slug>`, set `PROJECT_FEED_WORKSPACE`, link a directory with `pf link`, or run `pf config set defaultWorkspace <slug>`. See [Configuration and profiles](https://projectfeed.app/docs/cli/configuration/configuration).
    
4.  4.
    
    ### Run a first command
    
    Run `pf projects list` to confirm the key and workspace work, then find commands in the [command reference](https://projectfeed.app/docs/cli/command-reference).
    

Shell

```
npm install -g pfeed-cli
pf auth login
export PROJECT_FEED_WORKSPACE=<workspace-slug>
pf projects list
```

## Verify the installation and context

Shell

```
pf --version
pf auth status
pf auth check
pf workspace list
pf workspace current
pf projects list
```

-   Confirm the installed version runs under Node.js 22.12 or newer.
-   `pf auth status` shows where the selected key came from. `pf auth check` validates it against Project Feed.
-   `pf workspace list` lists available workspaces. `pf workspace current` confirms the slug used by workspace-scoped commands.
-   Run one read-only resource command before creating, editing, or deleting work.

## Core concepts

Commands follow a `resource action` pattern, similar to the GitHub CLI:

Shell

```
pf projects list
pf tasks create --project <project-id> --title "Fix login bug" --priority high
pf posts view 3
pf notifications unread-count
```

Add `--help` to any command, such as `pf tasks list --help`. The most-used commands end their help with examples, and every command ends with a link to its docs page.

### Interactive selection

When you run a view or edit command in a terminal without an ID, you get an interactive picker:

Shell

```
pf tasks view       # pick from a list
pf posts edit       # pick, then edit
```

## Know which workspace and project a command uses

API key

--api-key overrides PROJECT_FEED_API_KEY, which overrides the active profile. A .env value is treated as PROJECT_FEED_API_KEY and can shadow a selected profile.

Workspace

--workspace overrides PROJECT_FEED_WORKSPACE, a linked-directory workspace, and the profile default. With --api-key, only --workspace applies. When no workspace is configured, workspace commands infer it only if the key can access exactly one workspace.

Project

--project overrides PROJECT_FEED_PROJECT, a .pf/config.json directory link, and the profile defaultProject value.

Profile

--profile selects a profile for the command. Environment credentials still outrank credentials stored in that profile.

Run `pf auth status`, `pf workspace current`, and `pf config list` when a command appears to target the wrong account or workspace.

## Fix setup problems

pf is not found

Confirm the global npm bin directory is on PATH, or run the same command through npx pfeed-cli. Check pf --version after changing PATH.

No API key is found

Run pf auth login, set PROJECT_FEED_API_KEY for the process, or select the profile that contains the intended credential. Use pf auth status to confirm the source.

Authentication returns 401 or 403

Run pf auth check. For 401, replace an expired, revoked, or malformed key. For 403, inspect effective scopes, workspace access, workspace policy, membership, and the requested resource.

Multiple workspaces are available

A personal token can reach several workspaces. Pass --workspace for one command or set defaultWorkspace in the active profile. Run pf workspace list before choosing the slug.

The wrong profile or project is used

Check environment variables, .env, --profile, pf workspace current, directory links, and profile defaults in precedence order. Use explicit flags while correcting stored configuration.

The wrong API endpoint is used

Set PROJECT_FEED_API_URL in the shell or the current directory's .env, including /api/v1. The shell value takes precedence. A .env value must be a projectfeed.app HTTPS URL or a localhost URL. Without an override, the CLI uses https://projectfeed.app/api/v1.

## Next steps

-   [Sign in and choose credentials](https://projectfeed.app/docs/cli/configuration/authentication)
-   [Create and rotate a personal API token](https://projectfeed.app/docs/account/api-tokens)
