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
| Command | Protocol | |
|---|---|---|
astro spp | Space Packets | encode, decode, inspect, validate, stream, gen |
astro epp | Encapsulation Packets | encode, decode, inspect, validate, stream, gen |
astro tm | TM transfer frames | encode, decode, inspect, gaps, demux, gen |
astro tc | TC transfer frames | encode, decode, inspect, gen |
astro aos | AOS transfer frames | encode, decode, inspect, gaps, demux, gen |
astro usdl | USLP transfer frames | encode, decode, inspect, gen |
astro cadu | Channel Access Data Units | wrap, unwrap, inspect, sync, gen |
astro cltu | Command Link Transmission Units | wrap, unwrap, inspect, gen |
astro time | Time codes | encode, decode, inspect, now |
astro xtce | XTCE mission databases | validate, list, layout, decode, match |
astro pus | PUS services | encode, decode, services |
astro ldc | Lossless data compression | compress, decompress, inspect |
astro rhc | Robust housekeeping compression | compress, decompress |
astro cfdp | CCSDS File Delivery Protocol | decode |
astro ltp | Licklider Transmission Protocol | decode |
astro bp | Bundle Protocol v6 | decode, admin |
astro sle | Space Link Extension | decode |
astro cop | COP-1 control words | clcw-encode, clcw-decode |
astro pxdl | Proximity-1 data link | encode, decode, spdu |
astro pxsc | Proximity-1 coding | wrap, unwrap, sync, encode, decode |
astro ocsc | Optical coding | condition, randomize |
astro sdls | Space Data Link Security | inspect |
Shared flags
Every command that reads input takes:
| Flag | Default | Meaning |
|---|---|---|
--input | hex | hex for hex-encoded text, bin for raw binary |
Every command that writes output takes:
| Flag | Default | Meaning |
|---|---|---|
--format | varies | text, 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.binCRC 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 --crcLeave 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 referenceThese are the same pages as this section of the site.