An unofficial command-line client for the Planfix REST API, written in Go. Ships as a single self-contained binary.
Unofficial. pfix is an independent open-source project. It is not an official Planfix product and is not affiliated with, endorsed, sponsored, or funded by Planfix. The Planfix name is used only to describe the API this tool connects to.
Status: functional and actively developed. Typed commands cover tasks (including checklists), projects, contacts, users, reports, data tags, templates, custom fields, objects, files (including uploads), and comments; anything not covered yet is reachable through the raw
apipassthrough (remaining work is on the roadmap). Command and flag conventions may still change before v1.0.
Prebuilt binaries: download the archive for your platform from the Releases page, unpack it, and put pfix on your PATH.
Build from source (requires Go 1.26 or newer):
git clone https://github.com/a68366/pfix-cli
cd pfix-cli
go build -o pfix ./cmd/pfixOr via go install (installs to $(go env GOPATH)/bin):
go install github.com/a68366/pfix-cli/cmd/pfix@latestpfix talks to a Planfix account using a REST API token (create one in your Planfix account settings) and your account domain (e.g. example.planfix.com).
Interactive login stores credentials in a config profile:
pfix auth login
# Planfix domain (e.g. example.planfix.com): example.planfix.com
# API token: ********
pfix auth status # show the active profile and check the token
pfix auth logout # remove a profile's credentialsTo log in a second account without touching the first, save it under a separate profile:
pfix auth login --profile work # stores a distinct 'work' profileA bare pfix auth login re-run targets the active profile (flag > PFIX_PROFILE >
current profile > default) and asks for confirmation before overwriting an
existing one. Add --force to skip the prompt.
Check connectivity and that the active token is accepted with pfix ping — it prints
OK on success (--json for the raw response, -q to print nothing and just set the
exit code) and exits non-zero if the token is rejected. It is the lightest such check;
pfix auth status uses the same GET /ping probe to validate the token.
Show who the active token belongs to with pfix whoami — id, name, login, email,
type, account, and groups (-q prints just the id, e.g. user:1; --json the raw
response). pfix auth status adds the same identity as a User: line.
Print the client version — number, commit, and build date — with pfix version
or the equivalent pfix --version.
For CI and automation, skip the config file and pass credentials via the environment:
export PFIX_DOMAIN=example.planfix.com
export PFIX_TOKEN=your-token
pfix api task/1Typed commands print a human-readable table (or a key/value detail block for a single item) by default. A handful of global flags shape the output of every typed command:
| Flag | Effect |
|---|---|
--json |
Emit the raw Planfix API response (pretty-printed) instead of a table — the machine-readable path |
--jq '<expr>' |
Filter the JSON output through a jq expression, one result per line (implies --json) |
--fields a,b,c |
Override which Planfix fields are requested and shown as columns (defaults are per-command) |
-q, --quiet |
Drop the table header (lists), or print only the affected id (create/update/delete, contact restore, file rename, comment add/edit/delete, checklist add/update/delete) |
Reshaping JSON with --jq. --jq runs a jq expression over the same JSON
--json would print, so you don't need to pass both. A result that is a bare
string prints raw and unquoted (pipe-friendly); any other result (object,
array, number, bool, null) prints as compact JSON, one result per line. An
invalid expression is rejected before any request is made. The jq engine is
embedded in pfix — no external jq binary is required. Integer values,
including ids beyond 2^53, are preserved exactly through --jq; fractional
numbers follow jq's usual number model.
Filtering lists. The list commands for task, project, contact, user,
report, datatag, and object accept --filter <json> — a raw Planfix filters
array forwarded to the API:
pfix task list --filter '[{"type":51,"operator":"equal","value":42}]'Filter type codes are Planfix-specific; see the Planfix REST filter reference for
the available types and operators.
Saved filters (task only). Instead of a raw array, task list can apply one of
the account's saved filters by id with --saved-filter. List the available filters —
system ones (:all, :in, :out, :audit) and user-defined views — with task filters:
pfix task filters # table of saved task filters (ID / NAME / OWNER)
pfix task list --saved-filter :in # apply the "Incoming" saved filter
pfix task list --saved-filter 220612A saved-filter id is an opaque string. --filter and --saved-filter combine as a
logical AND — the raw filter further narrows the saved view (both constraints apply
together, verified against the API).
# List tasks (table). --limit / --offset page the results.
pfix task list
pfix task list --limit 20 --offset 20
pfix task list --fields id,name,status # choose your own columns
pfix task list --json # raw API response
pfix task list --saved-filter :in # apply a saved filter (see: pfix task filters)
pfix task filters # list saved task filters
pfix task list --jq '.tasks[].name' # just the names, one per line
# Discover the status ids --status accepts (resolves the task's process)
pfix task statuses 17
pfix task statuses --process 234106 # or query a process directly
pfix task processes # list task processes (ID / NAME)
# View one task (detail block, or --json for everything)
pfix task view 17
pfix task view 17 --json
pfix task view 17 --jq '.task.status.name' # a single value, unquoted
# Create a task (--name required); prints the new id
pfix task create --name "Deploy release" --description "ship it"
pfix task create --name "Release prep" --template 6 --project 21 \
--assignees user:1,contact:4 --auditors group:3 --end-date 2026-07-20
pfix task create --name "Quick task" -q # prints just the id
# Update a task — pass any field flag (people lists and dates are replaced, not merged)
pfix task update 17 --status 2
pfix task update 17 --name "Renamed" --description "new body"
pfix task update 17 --assignees user:1 --priority Urgent --start-date "2026-07-08 10:00"
# Delete a task — requires --force and cannot be undone. Its checklist goes with it;
# its subtasks do NOT (they become top-level tasks); comments and files stay.
pfix task delete 17 --force
# Set custom fields (id is the numeric custom-field id; repeatable)
pfix task create --template 6 --name "Lead" --cf 88206=hello --cf 85984=42
# Update a custom field
pfix task update 57 --cf 88206=updated-value
# A list field takes an option label, not a number
pfix task update 57 --cf 88210=Urgent
# Quote the whole pair if the label contains spaces
pfix task update 57 --cf "88210=Waiting for reply"
# Clear a custom field — an empty value, on update only
pfix task update 57 --cf 88206=
# Read custom fields back — request the numeric ids via --fields
pfix task view 57 --fields id,name,88206
# Comments — list/add are task-scoped; view/edit/delete live in their own
# 'comment' group (see the Comments section below) and take a comment's own id
pfix task comment list 17
pfix task comment list 17 --include-deleted # show soft-deleted comments too (adds a DELETED column)
pfix task comment add 17 --body "Looks good"
pfix task comment add 17 --body "Looks good" --pinned --silent
echo "comment from stdin" | pfix task comment add 17Notes:
- A task's description is its first comment in Planfix — it shows up in
comment listas well as inview. --statustakes a numeric status id — discover the valid ids for a task withpfix task statuses <id>(or--process <id>).--status 0is the Draft status: it can be set at create time, but the API will not move an existing task back to Draft on update. Field names for--fieldsare Planfix REST field names; unknown names are silently ignored by the API. Run a command with--helpto see the fields it can request.--assignees/--auditors/--participantstake comma-separated prefixed references —user:N,contact:N, orgroup:N. Onupdatethe list you pass replaces the stored one.--start-date/--end-dateacceptYYYY-MM-DD,"YYYY-MM-DD HH:MM", orYYYY-MM-DDTHH:MM; Planfix interprets the time in the account's timezone.--priorityisUrgentorNotUrgent(validated locally — the API would silently fall back toNotUrgenton anything else).--counterpartytakes a contact id orcontact:N.--templateexists only oncreate; a task's template cannot be changed afterwards.--cf <id>=<value>sets a custom-field value (repeatable);idis the numeric field id frompfix customfield list task. The value is typed from the field definition: short/multiline text is sent as a string, a number field as a number, and a list field as one of its option labels (a list has no option ids over REST). pfix checks the label against the field's options and refuses an unknown one — the API itself validates nothing and would store whatever it is given as a meaningless free-text value. A label is matched exactly: no trimming, no case folding. Labels may contain spaces, so quote the whole pair —--cf "88210=Waiting for reply". Other field types (dates, checkboxes, references, multi-select) aren't covered — set them viapfix api. Ontask update,--cf <id>=with an empty value clears the field, for those types too (a checkbox is unchecked); calculated and other computed fields can't be cleared.task createrefuses a clear. The field must be attached to the task's template/process; otherwise the API refuses the write (Custom field not permitted by id). Read the value back to confirm a write took. To read a custom field back ontask view, request its numeric id via--fields; it renders as an extraname = valuerow below the table.
A task can carry a checklist. Its items live under task checklist, and only
tasks have them — contacts and projects do not.
pfix task checklist list 17 # ID / DONE / NAME
pfix task checklist list 17 --fields id,name,parent
pfix task checklist view 17 29149 # one item, by task id + item id
pfix task checklist add 17 --name "Ship the release notes"
pfix task checklist add 17 --name "Draft" --done --assignees user:5
pfix task checklist add 17 --name "Sub-step" --parent 29149 # nest it
pfix task checklist update 17 29149 --done # tick it off
pfix task checklist update 17 29149 --done=false # untick it
pfix task checklist update 17 29149 --name "Ship the notes" --assignees user:5,group:7
pfix task checklist update 17 29150 --parent 29149 # move it under another item
pfix task checklist delete 17 29149 --force # also deletes its nested itemsdeleterequires--forceand cannot be undone. Deleting an item also deletes every item nested under it.updatesends only the flags you pass, so ticking an item leaves its text and assignees untouched.--assigneesreplaces the stored list.- Items nest.
--parenttakes another item of the same task, and the listing is flat but depth-first — each nested item follows its parent — so request--fields parentto see the structure. A top-level item's parent is the task. view,updateanddeletetake both ids, and the API treats them differently: a read resolves the item by its own id and ignores the task id, while a write checks the pair and answers400if the item belongs elsewhere. Take both ids fromchecklist list.- An assignee reference the API cannot resolve is dropped silently. Since
the list is replaced wholesale, a typo like
--assignees user:999999clears the item's assignees and still reports success — nothing in the response distinguishes it from a real change.
Planfix comments are global objects, not children of the task or contact they
hang off. view, edit, and delete take the comment's own id (as printed
by task comment list); listing and adding stay on the parent object — see
task comment list/add above.
pfix comment view 11849892
pfix comment edit 11849892 --body "Corrected"
pfix comment edit 11849892 --pinned=false
pfix comment delete 11849892 --force- Deleting requires
--forceand cannot be undone. The comment stays visible undertask comment list --include-deleted, but can no longer be viewed or edited. --include-deletedwidens the feed beyond soft-deleted comments: it also surfaces Planfix's own system entries (e.g. the record written when a task is renamed) that the default listing hides.- A task's first comment carries its description and cannot be deleted. Editing
it changes the comment only — the task's
descriptionfield keeps its original text. --fieldsoverrides the column set. Combining it with--include-deletedontask comment listdrops the DELETED column, so deleted and live rows then look identical.
The same shape as task, for Planfix projects (projects have no comments):
pfix project list # table; --limit / --offset page
pfix project list --fields id,name,owner # choose columns
pfix project view 12 # detail block (--json for everything)
pfix project create --name "Q3 Launch" # prints the new id
pfix project update 12 --name "Q3 Launch v2" --status 2Planfix contacts (people and companies). Note: contact create requires a
template id — find yours with pfix api contact/list --fields template or in the
Planfix UI.
pfix contact list # table; --limit / --offset page
pfix contact view 42 # detail block (--json for everything)
pfix contact processes # list contact processes (ID / NAME)
pfix contact groups # contact groups — how the base is segmented (ID / NAME)
pfix contact create --name "Ada" --lastname "Lovelace" --template 1 --email ada@example.com
pfix contact update 42 --email new@example.com --lastname "Byron"
pfix contact delete 42 --force # moves it to the trash (requires --force)
pfix contact restore 42 # brings it back intact, same idPlanfix staff/users, read-only (the API does not allow creating users):
pfix user list # table; --limit / --offset page
pfix user view 1 # detail block (--json for everything)
pfix user list --fields id,name,role # choose columns
pfix user groups # employee groups — the group:N refs used by --assignees
pfix user positions # job positions (ID / NAME)Planfix saved reports, read-only (definitions; running a report is not yet supported):
pfix report list # table of saved reports
pfix report view 209428 # report definition (--json for the full column list)List the templates available for an object type (read-only):
pfix template list task # task templates
pfix template list contact # contact templates (people + companies)
pfix template list projectPlanfix objects, read-only:
pfix object list # table; --limit / --offset page
pfix object view 1 # detail block (--json for everything)List the custom-field definitions for an object type (read-only):
pfix customfield list task # custom fields defined on tasks
pfix customfield list contact # (empty if none are defined)
pfix customfield list task # TYPE column shows the type name (e.g. "Number")
pfix customfield types # the custom-field type catalog (ID / NAME)The TYPE column of customfield list shows the decoded type name in the default view; with --fields (or --json) the raw numeric code is shown.
Planfix data tags (custom structured-data record types), read-only:
pfix datatag list # table of data tags
pfix datatag view 4 # a tag's definition (--json for its field list)List, download, and upload the files on a task, contact, or project, and the editor images embedded in a description or comment, which the attachment API never returns:
pfix task files 17 # attached files: table of ID / NAME / SIZE
pfix task files 17 --source inline # editor-uploaded images, scraped from the HTML
pfix task files 17 --description-only # only files attached via the description
pfix contact files 42 --source inline
pfix project files 12 --limit 20 --offset 20 # project pages instead of --description-only
pfix file view 6340746 # one file's metadata (ID / NAME / SIZE / LINK)
pfix file download 6340746 # writes ./<file-name> (looks up the name first)
pfix file download 6340746 -o report.pdf # writes to a chosen path
pfix file download 6340746 -o - # streams the bytes to stdoutfile download refuses to overwrite an existing file unless --force, and
rejects --json/--jq — it writes raw bytes, not JSON.
Upload a file, optionally attaching it to a task, contact, or project:
pfix file upload report.pdf # prints: Uploaded report.pdf as file <id>
pfix file upload report.pdf --name "May report.pdf"
pfix file upload report.pdf --task 17 # upload, then attach to task 17
pfix file upload --from-url https://example.com/spec.json --contact 42
pfix file upload report.pdf -q # print only the new file idFiles are limited to 100 MiB (checked before anything is sent), and an upload
is never retried. --from-url stores whatever the URL returns — including an
error page — and still reports success, so check the result with file view.
If attaching fails, the upload is kept and the error names its file id.
Rename or delete a file:
pfix file rename 6340746 "May report.pdf" # no path separators or control characters
pfix file delete 6340746 --force # requires --force and cannot be undonefile delete removes the file from every task, contact, and project it is
attached to, but does not erase it: it stays viewable and downloadable by id.
A deleted file cannot be renamed or attached again.
pfix api <path> makes an authenticated request to any Planfix REST endpoint and prints the raw JSON response — handy for endpoints without a dedicated command yet, and for scripting.
Only GET/HEAD/OPTIONS requests are retried on a connection error or 5xx; every other method is sent exactly once.
# GET a task
pfix api task/1
# POST a JSON body from stdin — the primary path for Planfix's nested request bodies
echo '{"pageSize":5,"fields":"id,name"}' | pfix api task/list --input -
# Set simple typed parameters (auto-switches the method to POST)
pfix api task/ -F name="Deploy" -F template=42
# Add a header, include the response status/headers in the output
pfix api task/1 -H "X-Custom: value" -iFlags:
| Flag | Meaning |
|---|---|
-X, --method |
HTTP method (default GET, or POST when a body/fields are supplied) |
-F, --field key=value |
Typed parameter: integers, true/false/null, or @file/@- (file/stdin) |
-f, --raw-field key=value |
String parameter |
--input <file|-> |
Send a raw request body (- reads stdin) |
-H, --header key:value |
Add a request header |
-i, --include |
Print the response status and headers |
--silent |
Suppress the response body |
A non-2xx response prints the body, then exits non-zero with the API error message on stderr.
Credentials live in ~/.config/pfix/config.yml (mode 0600) and support multiple named profiles:
current_profile: default
profiles:
default:
domain: example.planfix.com
token: "..."
staging:
domain: staging.planfix.com
token: "..."Choose a profile per command with --profile staging or PFIX_PROFILE=staging. Resolution precedence is flags > environment > config file; the environment variables are PFIX_DOMAIN, PFIX_TOKEN, PFIX_PROFILE, and PFIX_CONFIG (overrides the config file path).
Manage profiles without editing the file by hand:
pfix config list # table of profiles; * marks the active one
pfix config show # active profile's domain + masked token (or: config show <name>)
pfix config use staging # set the active profile (current_profile)pfix honors the standard proxy environment variables for every command: HTTPS_PROXY / HTTP_PROXY and NO_PROXY (their lowercase forms work too). The API is served over HTTPS, so HTTPS_PROXY is the one that usually matters; list any hosts to reach directly in NO_PROXY. ALL_PROXY is not consulted (a limitation of the Go standard library).
- A typed
directorycommand. - Running saved reports (
reportcurrently covers definitions only).
go test ./... # run the test suite
go vet ./... # static analysis
gofmt -l . # formatting check (prints nothing when clean)
go build -o pfix ./cmd/pfix # build the binary
golangci-lint run # lint — required, CI gates on itSee AGENTS.md for architecture and conventions.