tm1cm · Walkthrough 5 of 5
Run tm1cm unattended
In CI or a scheduled job there's nobody to type a password or sign in. tm1cm asks nothing there, and its exit code and log say what happened.
Logging in without a person
- tm1cm only asks when it runs in a terminal. Elsewhere, a password that isn't set is sent empty, and anything else it needs ends the run with a message naming the setting.
- Give the password from your CI's secrets with
--connect password=...(-c), so it's never in a file: every setting can be given this way. Or setcam_passportfor a CAM server. - A browser sign-in can't happen without a person: use a namespace that takes a password, or a passport.
Steps
A run that works exits with 0:
Terminal
tm1cm --mode get --environment test > get.log 2>&1; echo "exit code: $?"Output
exit code: 0PowerShell
tm1cm --mode get --environment test *> get.log; "exit code: $LASTEXITCODE"Output, as on macOS
exit code: 0A server that isn't there exits with 3:
Terminal
tm1cm --mode get --environment test -c base_url=http://localhost:1 > get.log 2>&1; echo "exit code: $?"Output
exit code: 3PowerShell
tm1cm --mode get --environment test -c base_url=http://localhost:1 *> get.log; "exit code: $LASTEXITCODE"Output, as on macOS
exit code: 3and the end of the output says what went wrong, and what to check:
Terminal
tail -4 get.logOutput
2026-01-01 09:00:00,000 - tm1cm.login - authenticator(415) - INFO - Logging in to http://localhost:1 with basic tm1cm: Couldn't reach TM1 at http://localhost:1: [Errno 61] Connection refused Check base_url (or address, port and ssl) in connect.yaml, and that the server is running. The full report is in ~/projects/sales/sales.log. Attach it if you report an issue at https://github.com/ajmyers/tm1cm/issuesPowerShell
Get-Content get.log -Tail 4Output, as on macOS
2026-01-01 09:00:00,000 - tm1cm.login - authenticator(415) - INFO - Logging in to http://localhost:1 with basic tm1cm: Couldn't reach TM1 at http://localhost:1: [Errno 61] Connection refused Check base_url (or address, port and ssl) in connect.yaml, and that the server is running. The full report is in ~/projects/sales/sales.log. Attach it if you report an issue at https://github.com/ajmyers/tm1cm/issuesA login TM1 refuses exits with 4:
Terminal
tm1cm --mode get --environment test -c password=not-the-password > get.log 2>&1 < /dev/null; echo "exit code: $?"Output
exit code: 4PowerShell
$null | tm1cm --mode get --environment test -c password=not-the-password *> get.log; "exit code: $LASTEXITCODE"Output, as on macOS
exit code: 4Terminal
tail -4 get.logOutput
2026-01-01 09:00:00,000 - skipcheck_tm1 - _login_locked(218) - WARNING - TM1 at http://localhost:8011/api/v1/ refused the login as Basic admin; not trying again for 30.0s tm1cm: TM1 refused the login for admin at http://localhost:8011. Check user and password in credentials.yaml. The full report is in ~/projects/sales/sales.log. Attach it if you report an issue at https://github.com/ajmyers/tm1cm/issuesPowerShell
Get-Content get.log -Tail 4Output, as on macOS
2026-01-01 09:00:00,000 - skipcheck_tm1 - _login_locked(218) - WARNING - TM1 at http://localhost:8011/api/v1/ refused the login as Basic admin; not trying again for 30.0s tm1cm: TM1 refused the login for admin at http://localhost:8011. Check user and password in credentials.yaml. The full report is in ~/projects/sales/sales.log. Attach it if you report an issue at https://github.com/ajmyers/tm1cm/issues
Exit codes
A script or CI job can tell what went wrong from the exit code: 2 for a setting, file or argument, 3 when TM1 can't be reached, 4 when the login is refused, 5 when TM1 refused some objects (the rest were done, and the failures are listed at the end), and 70 for something unexpected. Every exit code.
The log
Every run writes <project>.log in the folder it runs in (--log names another): what it did, and when something goes wrong, a full report with the traceback, the versions and the servers. Passwords and passports are masked in it. Attach it when you report an issue. --debug adds every request tm1cm sends.
More walkthroughs
- Set up a project and get your model: Install tm1cm, make a project, connect it to your server, and write the model to files.
- Log in to TM1: Keep passwords out of files, sign in to CAM and through a browser, and give settings on the command line.
- Promote a change with git: Commit the model, change it, review the change, and put exactly that commit on the next server.
- Pick changes in the interactive shell: See what differs between two environments, and do only the changes you pick.
All the settings, filters, options and exit codes are in the reference.