| name | pex:setup |
| description | ProcurementExpress CLI setup, authentication, company selection, and configuration. Use when authenticating to the ProcurementExpress API (V1 token or V3 OAuth2), switching companies, managing config profiles (production/staging), or checking auth status. Also covers installing the CLI and skills into a project. Triggers on: pex setup, pex install, pex auth, login, authenticate, token, switch company, config profile, staging, production, pex config, who am i, current user.
|
ProcurementExpress CLI Setup
Installation
CLI
npm install -g @procurementexpress/cli
git clone https://github.com/przbadu/procurementexpress-cli.git
cd procurementexpress-cli && npm install && npm run build && npm link
Skills (copy into any project)
cp -r /path/to/procurementexpress-cli/.claude/skills/pex-* /path/to/your-project/.claude/skills/
Once published to npm, this will be automated:
npx @procurementexpress/cli install-skills
Authentication
Authentication is required before any API command. Credentials persist in config.
V1 Token Auth (simple, recommended)
pex auth login --token=<TOKEN> --company-id=<COMPANY_ID>
V3 OAuth2 Auth (email/password)
pex auth login --email=user@co.com --password=secret \
--client-id=<ID> --client-secret=<SECRET> --api-version=v3
Verify Auth
pex auth status
pex auth whoami
Logout
pex auth logout
Company Selection
After authenticating, set the active company:
pex company list
pex company set <COMPANY_ID>
pex company details
Config Profiles (Staging/Production)
pex config add-profile staging --base-url=https://staging.procurementexpress.com
pex config use staging
pex auth login --token=STAGING_TOKEN --company-id=STAGING_ID
pex config use production
pex config show
pex config set defaultFormat table
Priority Order (highest wins)
- CLI flags:
--token, --base-url, --company-id, --api-version
- Environment variables:
PROCUREMENTEXPRESS_AUTH_TOKEN, PROCUREMENTEXPRESS_API_BASE_URL, PROCUREMENTEXPRESS_COMPANY_ID, PROCUREMENTEXPRESS_API_VERSION
- Active profile in config file
Current User Management
pex auth whoami
pex auth update-profile --name="Jane Doe" --first-name="Jane" --last-name="Doe" \
--email="jane@co.com" --phone-number="+1-555-0100"
Typical Setup Workflow
1. pex auth login --token=<TOKEN> --company-id=<ID>
2. pex company list # see available companies
3. pex company set <COMPANY_ID> # pick working company
4. pex company details # verify settings, custom fields, currencies
5. Start using other pex commands