Command-line interface

IXMP4 provides a command line interface for some of its functionality. Use the --help option to find out more about any command:

ixmp4 --help
ixmp4 platforms --help
ixmp4 alembic --help
ixmp4 test --help
ixmp4 server --help

Platforms

                                                                      
 Usage: ixmp4 platforms [OPTIONS] COMMAND [ARGS]...                   
                                                                      
 Manages platforms via subcommands.                                   
                                                                      
╭─ Options ──────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                        │
╰────────────────────────────────────────────────────────────────────╯
╭─ Commands ─────────────────────────────────────────────────────────╮
│ add       Adds a new platform to ixmp4's toml registry.            │
│ remove    Removes a platform from ixmp4's toml registry.           │
│ list      Lists all registered platforms.                          │
│ generate  Generates mock test data and loads it into a platform.   │
│           Experimental and meant as a development tool. Use at     │
│           your own risk.                                           │
╰────────────────────────────────────────────────────────────────────╯

Create a local sqlite platform:

ixmp4 platforms add test [--dsn sqlite://my/database/file.db]

If --dsn is not supplied you will be prompted to create an sqlite database at a standardized location.

Register a postgresql database:

ixmp4 platforms add postgres --dsn postgresql+psycopg://user:pw@host/db

List all available platforms from the local toml file and the configured manager API:

ixmp4 platforms list

Remove platforms from your local toml file:

ixmp4 platforms delete test
ixmp4 platforms delete postgres

IIASA Infrastructure

By default only public IIASA platforms will be available to all users. If you want to log in using your ECE Manger account, use the ixmp4 login <username> command.

                                                                      
 Usage: ixmp4 login [OPTIONS] USERNAME                                
                                                                      
 Logs into the configured manager service.                            
                                                                      
╭─ Arguments ────────────────────────────────────────────────────────╮
│ *    username      TEXT  Your username. [required]                 │
╰────────────────────────────────────────────────────────────────────╯
╭─ Options ──────────────────────────────────────────────────────────╮
│ *  --password        TEXT  Your password. Will be saved in         │
│                            plain-text.                             │
│                            [required]                              │
│    --help                  Show this message and exit.             │
╰────────────────────────────────────────────────────────────────────╯

To delete locally saved credentials and return to anonymous use:

                                                                      
 Usage: ixmp4 logout [OPTIONS]                                        
                                                                      
 Logs out and deletes local credentials.                              
                                                                      
╭─ Options ──────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                        │
╰────────────────────────────────────────────────────────────────────╯

Alembic CLI

                                                                      
 Usage: ixmp4 alembic [OPTIONS] COMMAND [ARGS]...                     
                                                                      
 Manages alembic migrations on selected platforms via subcommands.    
                                                                      
╭─ Options ──────────────────────────────────────────────────────────╮
│ --platform  -p                  TEXT  Use (a) platform name(s) as  │
│                                       an alembic command target.   │
│ --toml          --no-toml             Use platforms from the       │
│                                       platforms.toml file as       │
│                                       alembic targets.             │
│                                       [default: no-toml]           │
│ --manager       --no-manager          Use platforms from the       │
│                                       manager api as alembic       │
│                                       targets.                     │
│                                       [default: no-manager]        │
│ --help                                Show this message and exit.  │
╰────────────────────────────────────────────────────────────────────╯
╭─ Commands ─────────────────────────────────────────────────────────╮
│ compare       Compare the current metadata structure (populated by │
│               database models) against the database.               │
│               Note: Currently there is a bug emitting some         │
│               unnecessary changes when using this command.         │
│ revisions     List all database revisions.                         │
│ autogenerate  Autogenerate a new migration revision.               │
│ upgrade       Upgrade the database to the given revision ('head'   │
│               per default).                                        │
│ downgrade     Downgrade the database to the given revision (first  │
│               previous revision per default).                      │
│ stamp         Stamp the database to the given revision !without    │
│               running migrations!.                                 │
│               This may break the migration logic. Use with care!   │
╰────────────────────────────────────────────────────────────────────╯

IXMP4 Server

                                                                      
 Usage: ixmp4 server [OPTIONS] COMMAND [ARGS]...                      
                                                                      
 Enables use of the http server.                                      
                                                                      
╭─ Options ──────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                        │
╰────────────────────────────────────────────────────────────────────╯
╭─ Commands ─────────────────────────────────────────────────────────╮
│ start        Starts the ixmp4 http server.                         │
│ dump-schema                                                        │
╰────────────────────────────────────────────────────────────────────╯

Tests