CLI Overview
Lankir provides a comprehensive command-line interface for automation and scripting.
Basic Usage
lankir <command> [subcommand] [options] [arguments]
When run without arguments, Lankir launches the GUI. With any arguments, it runs in CLI mode.
Global Options
Option |
Description |
|---|---|
|
Show help for command |
|
Enable verbose/debug logging |
|
Output in JSON format (where supported) |
Command Groups
Command |
Description |
|---|---|
|
PDF file operations (info, render, pages) |
|
Certificate management (list, search) |
|
Signing operations (sign, verify, profiles) |
|
Configuration management (get, set, reset) |
|
Launch the graphical interface |
Quick Examples
# View PDF information
lankir pdf info document.pdf
# List available certificates
lankir cert list --valid-only
# Sign a PDF
lankir sign pdf input.pdf output.pdf --cert ABC123...
# Verify signatures
lankir sign verify signed.pdf
# View configuration
lankir config get
Getting Help
# General help
lankir --help
# Command-specific help
lankir pdf --help
lankir sign pdf --help
Exit Codes
Code |
Meaning |
|---|---|
0 |
Success |
1 |
General error |
2 |
Invalid arguments |
Output Formats
Human-Readable (Default)
lankir pdf info document.pdf
# Output:
PDF Information:
File: document.pdf
Title: Annual Report
Pages: 42
JSON
lankir pdf info document.pdf --json
# Output:
{
"filePath": "document.pdf",
"title": "Annual Report",
"pageCount": 42
}
Verbose Mode
Enable detailed logging for debugging:
lankir --verbose sign pdf doc.pdf out.pdf --cert ABC123...
# Outputs debug information to stderr
Piping and Scripting
Combining with Other Tools
# Count pages in multiple PDFs
for pdf in *.pdf; do
pages=$(lankir pdf info "$pdf" --json | jq '.pageCount')
echo "$pdf: $pages pages"
done
# Find signed PDFs
for pdf in *.pdf; do
if lankir sign verify "$pdf" --json 2>/dev/null | jq -e '.[0]' > /dev/null; then
echo "$pdf is signed"
fi
done
Error Handling
#!/bin/bash
set -e
lankir sign pdf input.pdf output.pdf --cert "$CERT" || {
echo "Signing failed" >&2
exit 1
}
Environment Variables
Variable |
Description |
|---|---|
|
Override config directory |
|
Enable debug mode ( |
Next Steps
PDF Commands - File operations
Certificate Commands - Certificate management
Sign Commands - Signing and verification
Config Commands - Configuration