Account

fw login

login

Log in to Framework Cloud

Added in 0.1.0.

Logs in to framework.pub or a self-hosted server and makes it the default.

By default fw opens a browser to approve the login. --paste asks for a token from the server's tokens page instead, and --with-token reads one from stdin. The token is stored in the system keyring, where the R and Python packages find it too.

Without a terminal, as when an AI agent runs fw, pass --yes after reading the notice. fw prints a code and a link on stderr and waits while a person approves it in a browser. The agent never sees the token.

Usage

fw login [flags]

Options

Name Type Description
--json bool

print JSON on stdout, for scripts and agents; the browser code goes to stderr as JSON

--paste bool

paste a token instead of approving in a browser

--url string

Framework Cloud server (default: FW_CLOUD_URL, your last login, or framework.pub)

Environment variable: FW_CLOUD_URL

--with-token bool

read the token from stdin

-y, --yes bool

confirm connecting without a prompt

Value

With --json, stdout gets the same object as fw status --json. Without a terminal, the code to approve goes to stderr as one JSON line:

{"user_code": "QGMK-JE6Q", "verification_url": "https://framework.pub/device?code=QGMK-JE6Q", "expires_in": 600}

Exit codes

Code Meaning
0 Success
1 Failure
2 Bad flags or arguments
3 Not logged in, or the server rejected the token
4 The server has no such project or resource
5 Browser login was denied, or its code expired
6 An upload has "private" in a path; rerun with --include-private if you mean to send it

With --json, a failure also prints one JSON line on stderr: {"error": "...", "exit_code": 4}. Exit code 6 adds "reason": "private_path".

Examples

Not run

fw login
fw login --url https://framework.example.edu
fw login --with-token --yes < token.txt
fw login --yes --json

Related reference