oxid output

Display output values defined in your configuration. Supports Terraform-compatible JSON format for scripting and CI integration.

Usage

oxid output [name] [flags]

The output command shows the values of outputs defined in your .tf configuration. Outputs are evaluated and persisted to the state database during oxid apply.

Basic Usage

$ oxid output

vpc_id       = "vpc-0a1b2c3d4e5f67890"
api_endpoint = "https://api.example.com"
db_password  = <sensitive>

Sensitive outputs are masked in the default display. Use --json to retrieve them programmatically.

Single Output

Retrieve a specific output by name:

$ oxid output vpc_id

"vpc-0a1b2c3d4e5f67890"

JSON Format

The --json flag produces Terraform-compatible JSON output, suitable for scripting and integration with other tools:

$ oxid output --json

{
  "vpc_id": {
    "value": "vpc-0a1b2c3d4e5f67890",
    "type": "string",
    "sensitive": false
  },
  "api_endpoint": {
    "value": "https://api.example.com",
    "type": "string",
    "sensitive": false
  },
  "db_password": {
    "value": "s3cret-p@ssw0rd",
    "type": "string",
    "sensitive": true
  }
}
NoteWhen using --json, sensitive values are included in the output. Pipe carefully and avoid logging in CI.

Sensitive Outputs

Outputs marked with sensitive = true in your configuration are treated specially:

  • Displayed as <sensitive> in the default (non-JSON) view
  • Included in --json output for programmatic access
  • Encrypted at rest when using the PostgreSQL backend with pgcrypto
  • Stored in plaintext in the local SQLite database (secure your .oxid/ directory)
outputs.tf
output "db_password" {
  value     = aws_db_instance.main.password
  sensitive = true
}

Flags

FlagDescriptionDefault
--jsonOutput in Terraform-compatible JSON format. Includes sensitive values.false

Scripting Examples

Extract a value with jq

VPC_ID=$(oxid output --json | jq -r '.vpc_id.value')
echo "VPC: $VPC_ID"

Pass to another tool

# Feed Oxid outputs into kubectl
API_URL=$(oxid output --json | jq -r '.api_endpoint.value')
kubectl set env deployment/app API_URL="$API_URL"

Query outputs via SQL

oxid query "SELECT name, value FROM outputs WHERE sensitive = false"