Astro~/0.3
** CLI / CLI * PAGE 01 / 87
** Astro * CLI
** /cli

CLI

Shared flags, input and output formats, and how to pipe commands together.

astro encodes, decodes, inspects, and validates CCSDS data from a terminal. It reads stdin and writes stdout, so commands pipe into each other and into jq.

If you have not used it yet, start with the CLI quickstart.

Commands

CommandProtocol
astro sppSpace Packetsencode, decode, inspect, validate, stream, gen
astro eppEncapsulation Packetsencode, decode, inspect, validate, stream, gen
astro tmTM transfer framesencode, decode, inspect, gaps, demux, gen
astro tcTC transfer framesencode, decode, inspect, gen
astro aosAOS transfer framesencode, decode, inspect, gaps, demux, gen
astro usdlUSLP transfer framesencode, decode, inspect, gen
astro caduChannel Access Data Unitswrap, unwrap, inspect, sync, gen
astro cltuCommand Link Transmission Unitswrap, unwrap, inspect, gen
astro timeTime codesencode, decode, inspect, now
astro xtceXTCE mission databasesvalidate, list, layout, decode, match
astro pusPUS servicesencode, decode, services
astro ldcLossless data compressioncompress, decompress, inspect
astro rhcRobust housekeeping compressioncompress, decompress
astro cfdpCCSDS File Delivery Protocoldecode
astro ltpLicklider Transmission Protocoldecode
astro bpBundle Protocol v6decode, admin
astro sleSpace Link Extensiondecode
astro copCOP-1 control wordsclcw-encode, clcw-decode
astro pxdlProximity-1 data linkencode, decode, spdu
astro pxscProximity-1 codingwrap, unwrap, sync, encode, decode
astro ocscOptical codingcondition, randomize
astro sdlsSpace Data Link Securityinspect

Shared flags

Every command that reads input takes:

FlagDefaultMeaning
--inputhexhex for hex-encoded text, bin for raw binary

Every command that writes output takes:

FlagDefaultMeaning
--formatvariestext, json, or hex

Input comes from a file argument or from stdin. Hex input tolerates a 0x prefix, spaces, and newlines, so you can paste from a log without cleaning it up.

The verbs

They mean the same thing everywhere.

encode builds a unit from flags. decode takes one apart into fields. inspect does the same but prints an annotated hex dump alongside. This is the one for staring at a capture. validate checks a unit is well formed and reports what is wrong. stream reads a concatenated run of units from a file or pipe. gen produces synthetic test data. wrap and unwrap add and remove a coding layer.

Piping

Layers compose the way the protocol stack does:

# Packet -> frame -> CADU
PKT=$(astro spp encode --apid 100 --type tm --data 68656c6c6f)
FRAME=$(astro tm encode --scid 42 --vcid 0 --data "$PKT")
echo "$FRAME" | astro cadu wrap --input hex
# Encode, then look at what you built
astro spp encode --apid 100 --type tm --data 68656c6c6f \
  | astro spp inspect --input hex
# Anything decodable can go to jq
astro spp gen --apid 100 --count 100 --format hex \
  | astro spp stream --input hex --format json \
  | jq 'select(.apid == 100) | .sequence_count'

Binary files

Use --format bin on the way out and --input bin on the way in:

astro spp gen --apid 100 --count 1000 --format bin > capture.bin
astro spp stream --input bin capture.bin

CRC handling

Where a protocol makes error control optional, both ends must agree. Pass --crc when encoding and when decoding:

astro spp encode --apid 100 --type tm --data a1b2c3d4 --crc \
  | astro spp validate --input hex --crc

Leave it off the decode side and the CRC bytes come back as payload. That mismatch is the most common first bug.

Built-in manual

Every command's full reference is embedded in the binary:

astro manual        # list the topics
astro manual spp    # the full spp reference

These are the same pages as this section of the site.

** CCSDS and ECSS space communication standards, implemented in Go. **PAGE 01 / 87