pixcli
Getting Started

Configuration

Set up pixcli with your PSP credentials

Interactive Setup

The fastest way to configure pixcli:

pixcli config init

This wizard walks you through:

  1. Choosing a PSP backend (currently Efí/Gerencianet)
  2. Selecting the environment (sandbox or production)
  3. Entering your Client ID and Client Secret
  4. Specifying the path to your P12/PEM certificate
  5. Setting your default Pix key

Config File Location

pixcli stores its configuration at:

~/.pixcli/config.toml

You can override this with the PIXCLI_CONFIG environment variable:

export PIXCLI_CONFIG=/path/to/custom/config.toml

Config File Format

[defaults]
profile = "sandbox"
output = "human"

[profiles.sandbox]
backend = "efi"
environment = "sandbox"
client_id = "Client_Id_abc123..."
client_secret = "Client_Secret_xyz789..."
certificate = "/home/user/.pixcli/certs/sandbox.p12"
certificate_password = ""
pix_key = "+5511999999999"

[profiles.production]
backend = "efi"
environment = "production"
client_id = "Client_Id_prod..."
client_secret = "Client_Secret_prod..."
certificate = "/home/user/.pixcli/certs/production.p12"
certificate_password = "my-secure-password"
pix_key = "+5511999999999"

Fields Reference

FieldRequiredDescription
backendYesPSP backend (efi)
environmentYessandbox or production
client_idYesOAuth2 Client ID from your PSP
client_secretYesOAuth2 Client Secret from your PSP
certificateYesPath to P12/PEM certificate for mTLS
certificate_passwordNoPassword for the P12 certificate
pix_keyNoDefault Pix key for charges

Environment Variables

All config values can be overridden via environment variables:

VariableOverrides
PIXCLI_CONFIGConfig file path
PIXCLI_CLIENT_IDclient_id
PIXCLI_CLIENT_SECRETclient_secret
PIXCLI_CERTIFICATEcertificate
PIXCLI_CERTIFICATE_PASSWORDcertificate_password
PIXCLI_PIX_KEYpix_key
PIXCLI_ENVIRONMENTenvironment

Multiple Profiles

Use profiles to switch between sandbox and production:

# Use the sandbox profile
pixcli --profile sandbox balance

# Use production
pixcli --profile production balance

# Or force sandbox mode on any profile
pixcli --sandbox balance

Verify Configuration

pixcli config show

Output (secrets are redacted):

⚙️  pixcli Configuration
   Path:    /home/user/.pixcli/config.toml
   Default: sandbox
   Output:  human

   📋 Profile: sandbox
      Backend:     efi
      Environment: sandbox
      Client ID:   Client_Id_abc1...
      Secret:      ***
      Certificate: /home/user/.pixcli/certs/sandbox.p12
      Pix Key:     +5511999999999

Never commit your config.toml or certificates to version control. The .pixcli/ directory should remain in your home folder.

Next Steps

With configuration in place, try generating your first QR code.

On this page