AtPack Parser Interactive Mode
Interactive mode provides an enhanced command-line interface with auto-completion, command history, and Rich interface for a better user experience.
Installation
To use interactive mode, install prompt-toolkit:
Launch
Features
๐ฏ Auto-completion
- Type the beginning of a command and press TAB for auto-completion
- Navigate with up/down arrows through command history
๐จ Rich Interface
- Colored and formatted tables
- Clear information panels
- Colored status messages
๐ History
- All commands are saved in session history
- Navigate with โ/โ
Available Commands
Command | Description | Example |
---|---|---|
help |
Show help | help |
scan [dir] |
Scan directory for AtPack files | scan ./atpacks |
load <file> |
Load an AtPack file | load mypack.atpack |
devices |
List all devices | devices |
select <device> |
Select a device | select PIC16F877 |
device-info |
Info about selected device | device-info |
memory |
Device memory layout | memory |
registers |
Device registers | registers |
status |
Session status | status |
clear |
Clear screen | clear |
exit/quit |
Exit session | exit |
Typical Workflow
- Start :
atpack interactive
โญโโโโโโโโโ Interactive Session โโโโโโโโโโฎ
โ ๐ง AtPack Parser - Interactive Mode โ
โ Type 'help' to see available commands โ
โ Type 'exit' to quit โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
and see the help menu
atpack โฏ help
Available Commands
โโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโ
โ Command โ Description โ Example โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ help โ Show this help โ help โ
โ scan โ Scan directory for AtPack files โ scan ./atpacks โ
โ load <file> โ Load an AtPack file โ load mypack.atpack โ
โ devices โ List all devices โ devices โ
โ select <device> โ Select a device โ select ATmega328P โ
โ device-info โ Show selected device information โ device-info โ
โ memory โ Show device memory layout โ memory โ
โ registers โ Show device registers โ registers โ
โ files โ Show files in AtPack โ files โ
โ config โ Show AtPack configuration โ config โ
โ status โ Show session status โ status โ
โ clear โ Clear screen โ clear โ
โ exit/quit โ Exit session โ exit โ
โโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโ
- Auto-scan : The
./atpacks
directory is automatically scanned
atpack โฏ scan
Scanning directory: ./atpacks
AtPack Files Found (3)
โโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโ
โ No. โ File โ Size โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ 1 โ Atmel.ATmega_DFP.2.2.509.atpack โ 31.8 MB โ
โ 2 โ Microchip.PIC16Fxxx_DFP.1.7.162.atpack โ 5.8 MB โ
โ 3 โ Microchip.PIC24F-KA-KL-KM_DFP.1.5.253.atpack โ 4.8 MB โ
โโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโ
- Load :
load mypack.atpack
(or interactive selection)
atpack โฏ load
Available AtPack files:
1. Atmel.ATmega_DFP.2.2.509.atpack
2. Microchip.PIC16Fxxx_DFP.1.7.162.atpack
3. Microchip.PIC24F-KA-KL-KM_DFP.1.5.253.atpack
Select a file (number or name)
[1/2/3/Atmel.ATmega_DFP.2.2.509.atpack/Microchip.PIC16Fxxx_DFP.1.7.162.atpack/Microchip.PIC24F-KA-KL-KM_DFP.1.5.253.atpa
ck]: 2
โ
AtPack loaded successfully!
Family: PIC
Devices: 164
- Navigate :
devices
to see devices
atpack[Microchip.PIC16Fxxx_DFP.1.7.162] โฏ devices
Devices (Page 1/9)
โโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโ
โ No. โ Device โ Status โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ 1 โ AC162052_AS_PIC16F630 โ โ
โ 2 โ AC162052_AS_PIC16F676 โ โ
โ 3 โ AC162053_AS_PIC16F627A โ โ
โ 4 โ AC162053_AS_PIC16F628A โ โ
โ 5 โ AC162053_AS_PIC16F648A โ โ
โ 6 โ AC162053_AS_PIC16LF627A โ โ
โ 7 โ AC162053_AS_PIC16LF628A โ โ
โ 8 โ AC162053_AS_PIC16LF648A โ โ
โ 9 โ AC162054_AS_PIC16F716 โ โ
โ 10 โ AC162055_AS_PIC16F684 โ โ
โ 11 โ AC162056_AS_PIC16F688 โ โ
โ 12 โ AC162057_AS_PIC16F636 โ โ
โ 13 โ AC162059_AS_PIC16F505 โ โ
โ 14 โ AC162060_AS_PIC16F785 โ โ
โ 15 โ AC162060_AS_PIC16HV785 โ โ
โ 16 โ AC162061_AS_PIC16F631 โ โ
โ 17 โ AC162061_AS_PIC16F677 โ โ
โ 18 โ AC162061_AS_PIC16F685 โ โ
โ 19 โ AC162061_AS_PIC16F687 โ โ
โ 20 โ AC162061_AS_PIC16F689 โ โ
โโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโ
Actions: (n)ext, (q)uit [n/q]:
- Select :
select PIC16F877
atpack[Microchip.PIC16Fxxx_DFP.1.7.162] โฏ select PIC16F877
โ
Device selected: PIC16F877
atpack[Microchip.PIC16Fxxx_DFP.1.7.162](PIC16F877) โฏ device-info
- Analyze :
device-info
,memory
,registers
atpack[Microchip.PIC16Fxxx_DFP.1.7.162](PIC16F877) โฏ device-info
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Device Information โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ Device: PIC16F877 โ
โ Family: PIC โ
โ Architecture: PIC โ
โ Package: Not specified โ
โ Flash Size: Not specified โ
โ RAM Size: Not specified โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
atpack[Microchip.PIC16Fxxx_DFP.1.7.162](PIC16F877) โฏ memory
Memory Layout - PIC16F877
โโโโโโโโโโโโโณโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโณโโโโโโโโโโโโโโ
โ Segment โ Start Address โ Size โ Description โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ PROG1 โ 0x0000 โ 2048 bytes โ โ
โ SFR_BANK0 โ 0x0000 โ 32 bytes โ โ
โ SFR_BANK1 โ 0x0080 โ 32 bytes โ โ
โ SFR_BANK2 โ 0x0100 โ 16 bytes โ โ
โ SFR_BANK3 โ 0x0180 โ 16 bytes โ โ
โ PROG2 โ 0x0800 โ 2048 bytes โ โ
โ PROG3 โ 0x1000 โ 2048 bytes โ โ
โ PROG4 โ 0x1800 โ 2048 bytes โ โ
โโโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโดโโโโโโโโโโโโโ
...
- Exit :
exit
Interactive Selection
File Loading
If you type load
without arguments, interactive mode offers:
- List of available AtPack files
- Selection by number or filename
- Automatic loading if only one file found
Device Selection
The select
command supports:
- Exact match : select PIC16F877
- Partial match : select 16F877A
(finds PIC16F877A)
- Multiple selection : If multiple matches, interactive choice
Usage Examples
Simple Session
Device Search
Contextual Navigation
The prompt shows the current context:
atpack โฏ load mypack.atpack
atpack[mypack] โฏ select ATmega328P
atpack[mypack](ATmega328P) โฏ memory
Keyboard Shortcuts
- Tab : Auto-completion
- โ/โ : Command history
- Ctrl+C : Interrupt (with confirmation)
- Ctrl+D : Quit
- Escape : Cancel current input
Error Handling
Interactive mode intelligently handles errors: - Clear colored error messages - Alternative command suggestions - Confirmation before destructive actions - Graceful error recovery
Advantages vs Standard CLI
Aspect | Standard CLI | Interactive Mode |
---|---|---|
Commands | atpack devices list file.atpack |
devices (in context) |
Auto-completion | No | Yes |
History | Shell only | Integrated |
Interface | Plain text | Rich/colored |
Selection | Repetitive arguments | Persistent context |
Navigation | Long commands | Fast navigation |
State diagram
stateDiagram-v2
[*] --> INITIAL
INITIAL --> INITIAL : scan, help, clear, status
INITIAL --> ATPACK_LOADED : load
INITIAL --> [*] : exit, quit
ATPACK_LOADED --> ATPACK_LOADED : scan, help, clear, status, info, devices, files, config
ATPACK_LOADED --> DEVICE_SELECTED : select
ATPACK_LOADED --> ATPACK_LOADED : load
ATPACK_LOADED --> [*] : exit, quit
DEVICE_SELECTED --> DEVICE_SELECTED : scan, help, clear, status, info, devices, files, config
DEVICE_SELECTED --> DEVICE_SELECTED : device-info, memory, registers, select
DEVICE_SELECTED --> ATPACK_LOADED : load
DEVICE_SELECTED --> [*] : exit, quit