cto.new works in a cloud virtual machine that we call a ‘task runner’.Properly configuring the task runner with system setup, project dependencies, and code checks will significantly improve the agent’s work.
cto.new can attempt to configure its own task runner using the setup agent
cto.new will automatically resize your VM’s memory to meet the needs of your project in increments of 2Gb from 4Gb to a maximum of 16Gb. Users that require more than 16Gb of memory should contact us.
Install and configure software, tools, and packages required at the system level.For example, this system setup configration installs Node 18 and configures a database to run tests:
Copy
# Downgrade to Node v18sudo apt-get remove -y nodejs && curl -fsSL https://deb.nodesource.com/setup_18.x | sudo bash - && sudo apt-get install -y nodejs# Create test databaseexport PGPASSWORD=postgres && psql -U postgres -c "CREATE DATABASE test_db;"# Run database migrationsnpm run migrate
Every VM has the following base system specification by deault.
Code checks are commands cto.new runs before committing your code, to ensure it passes and pre commit or pipeline steps.Use code checks to lint, test and build your code, for example:
Copy
# Run lintnpm run lint# Run buildnpm run build# Run testsnpm run test
Run a test to verify your task runner is confured properly and cto.new can successfuly make commits.Running a test can take several minutes but can be manually stopped.If your pipeline changes or you make any changes to cto.new’s VM you should re-run the tests to ensure cto.new can work effectively.