Command Line Interface
Overview
RDEToolKit provides a comprehensive command-line interface to support the development and execution of RDE structured processing. It supports the entire development workflow from project initialization to Excel invoice generation and archive creation.
Prerequisites
- Python 3.9 or higher
- rdetoolkit package installation
Available Commands
init: Create Startup Project
Creates a startup project for RDE structured processing.
1 | |
1 | |
The following directories and files will be generated:
1 2 3 4 5 6 7 8 9 10 11 | |
Description of each file:
- requirements.txt: Add Python packages you want to use for structured program construction. Run
pip installas needed. - modules: Store programs you want to use for structured processing.
- main.py: Define startup processing for structured programs
- data/inputdata: Place data files to be processed by structured processing.
- data/invoice: Required for local execution, even if empty.
- data/tasksupport: Place files that support structured processing.
File Overwriting
Existing files will be skipped from overwriting or generation.
Template-based Initialization
Pass --template <path> to reuse your own boilerplate. The path can point to either:
- A directory that contains
pyproject.tomlorrdeconfig.yaml/rdeconfig.yml - A direct path to one of the files above
When --template . is used, the command searches for pyproject.toml in the current directory first.
The configuration file must define template paths under [tool.rdetoolkit.init] (pyproject) or an init block (rdeconfig):
1 2 3 4 5 | |
Key meaning:
entry_point: File copied tocontainer/main.py.modules: File or directory copied undercontainer/modules/.tasksupport: File or directory mirrored to bothcontainer/data/tasksupport/andtemplates/tasksupport/.inputdata: Directory copied intocontainer/data/inputdata/andinput/inputdata/.
Relative paths are resolved from the configuration file location, so template repositories stay portable.
Specify template paths directly with PATH options
If you prefer not to store personal paths in config files, pass PATH options directly (can be combined). CLI-specified paths override values from config files; existing pyproject.toml / rdeconfig.yaml(yml) will be updated, or a new pyproject.toml will be created when missing.
| Option | Destination and role |
|---|---|
--entry-point |
Copied as container/main.py (file only) |
--modules |
Copied under container/modules/ (file or directory) |
--tasksupport |
Copied to both container/data/tasksupport/ and templates/tasksupport/ (file or directory) |
--inputdata |
Copied to container/data/inputdata/ and input/inputdata/ (directory recommended) |
--other (repeatable) |
Copies arbitrary files or directories under container/ |
Relative paths are saved from the current working directory. CLI-specified paths override values from config files.
Sample output with PATH options
Example run with templates under tpl/:
1 2 3 4 5 6 | |
Output (paths vary by environment):
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
After the run, [tool.rdetoolkit.init] (or init in rdeconfig.yaml) is written with the provided paths, stored as relative paths when possible.
make-excelinvoice: Generate Excel Invoice
Generates an Excel invoice from invoice.schema.json.
1 | |
1 | |
Options
| Option | Description | Required |
|---|---|---|
| -o(--output) | Output file path. The file path should end with _excel_invoice.xlsx. |
○ |
| -m | Mode selection. Choose registration mode. You can select file mode file or folder mode folder. |
- |
Default Output
If -o is not specified, it will be created as template_excel_invoice.xlsx in the execution directory.
gen-config: Generate rdeconfig.yaml Templates
Creates an rdeconfig.yaml file based on predefined templates or an interactive questionnaire.
1 | |
1 | |
Available templates:
minimal(default): System and traceback keys only.full: Includesmultidata_tiledefaults.multitile: Enablesextended_mode: "MultiDataTile".rdeformat: Enablesextended_mode: "rdeformat".smarttable: Adds SmartTable settings withsave_table_file: true.interactive: Guides you through each option. Use--lang jafor Japanese prompts.
Options
| Option | Description | Required |
|---|---|---|
| OUTPUT_DIR | Directory to place rdeconfig.yaml. Defaults to the current directory. |
- |
| --template | Template name (minimal, full, multitile, rdeformat, smarttable, interactive). |
- |
| --overwrite | Force overwrite of an existing rdeconfig.yaml without confirmation. Omit to be prompted. |
- |
| --lang | Prompt language (en or ja). Applicable only when --template interactive is selected. |
- |
Interactive Mode
When --template interactive is used, the command asks about system, MultiDataTile, SmartTable, and traceback
settings. Responses are written back into the generated rdeconfig.yaml so teams start with validated defaults.
version: Version Check
Check the version of rdetoolkit.
1 | |
1 | |
artifact: Create RDE Submission Archive
Creates an archive (.zip) for submission to RDE. Compresses the specified source directory and excludes files or directories that match exclusion patterns.
1 | |
1 | |
Options
| Option | Description | Required |
|---|---|---|
| -s(--source-dir) | Source directory to compress and scan | ○ |
| -o(--output-archive) | Output archive file (e.g., rde_template.zip) | - |
| -e(--exclude) | Directory names to exclude. By default, 'venv' and 'site-packages' are excluded | - |
Execution Report
When an archive is created, the following execution report is generated:
- Existence check of Dockerfile and requirements.txt
- List of included directories and files
- Code scan results (security risk detection)
- External communication check results
Sample execution report:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | |
External Communication Check Results
container/external.py
1 2 3 4 5 | |
Option Details
- If
--output-archiveis not specified, an archive will be created with a default filename. - The
--excludeoption can be specified multiple times (e.g.,--exclude venv --exclude .git).
Shell Completion
Shell completion functionality is available to help complete command and option names. Press the Tab key to display candidate suggestions.
Supported Shells
- Bash
- Zsh
- Fish
- PowerShell
Installation
Use the --install-completion option to install completion for your current shell:
1 | |
After execution, restart your shell to enable the completion feature.
1 2 | |
Manual Installation
To review the completion script before installing manually, use the --show-completion option:
1 | |
Add the displayed script to your shell configuration file.
For Bash
1 2 | |
For Zsh
1 2 | |
Usage Examples
After installing the completion feature, press the Tab key to display candidates.
1 2 3 4 5 6 7 8 9 10 11 | |
Uninstallation
To remove the completion feature, delete the corresponding lines from your shell configuration file.
For Bash, remove lines similar to the following from ~/.bashrc; for Zsh, from ~/.zshrc:
1 | |
Restart your shell after removal.
Next Steps
- Understand Structuring Processing Concepts
- Learn how to create Configuration Files
- Check detailed features in API Reference