Skip to content
Shomy edited this page Apr 9, 2024 · 4 revisions

General

The Kitsu tools repository brings you a complete tooling and setup bundle. We don't want to bother ourselves, much less you, with setting up a development environment for too long. The most notable part of said tooling consists of binstubs located in /bin to execute common tasks without the hassle.

For easier access, you can add ./bin or/and ../bin to your $PATH, in order to use those binstubs directly from the kitsu repository root or the web/server folder.

Binstubs

bin/attach

Usage: bin/attach [web, api, router, redis, worker, postgres, elasticsearch]
Will attach a bash shell to the specified container.

bin/build

Usage: bin/build []
Will build all docker containers, set up the development database and set the server environment to development.

bin/bundle

Usage: bin/bundle [...]
Will proxy the command you pass it to bundler running in the kitsu server container.

bin/check_for_updates

Usage: bin/check_for_updates Will check for remote updates in tooling, web and server directories.

bin/clean-docker

Usage: bin/clean-docker Will remove exited containers, unused images and containers.

bin/clean-uploads

Usage: bin/clean-uploads Will remove all uploads from ./uploads/kitsu-ugc-dev/.

bin/guard

tba

bin/logs

Usage: bin/logs [web, api, router, redis, worker, postgres, elasticsearch] [-f]
Will output the last lines of the log from the specified container. If no argument is given, log output from all containers will be returned. You may add the -f flag, in order to follow the log for a longer time.

bin/npm

Usage: bin/npm [...]
Will proxy the command you pass it to npm running in the kitsu web container.

bin/open-browser

Usage: bin/open-browser
Will attempt to open your browser with the host Kitsu is currently running on. If no command is successfully executed on your system, it will return the host name.

bin/pg_dump

Usage: bin/pg_dump [...]
Will dump the development database.

bin/port

Usage: bin/port []
Will output the port of the router container that is currently exposed for the internal port 80.

bin/psql

Usage: bin/psql [...]
Will proxy the command you pass it to postgres running in the kitsu server container.

bin/rails

Usage: bin/rails [...]
Will proxy the command you pass it to rails running in the kitsu server container.

bin/rake

Usage: bin/rake [...]
Will proxy the command you pass it to rake running in the kitsu server container.

bin/rebuild

Usage: bin/rebuild [web, api, router, redis, worker, postgres, elasticsearch, typesense, mailcatcher, minio]
Will stop, rebuild and then start the given container. If no container is specified, all containers will be rebuilt.

bin/redis-cli

Usage: bin/redis-cli [...] Will proxy the command you pass it to redis.

bin/restart

Usage: bin/restart [web, api, router, redis, worker, postgres, elasticsearch, typesense, mailcatcher, minio]
Will stop and restart the given container. If no container is specified, all containers will be restarted.

bin/rspec

Usage: bin/rspec [...]
Will proxy the command you pass it to rspec running in the kitsu server container.

bin/seed

Usage: bin/seed [download, reset, import, clean]
A collection of useful tools for seeding the local development database. For more information about the usage of seed, check this wiki article.

bin/setup

Usage: bin/setup
Will run the interactive setup. This should be done right after the tools repository is cloned, as it will set up everything else.

bin/start

Usage: bin/start [web, api, router, redis, worker, postgres, elasticsearch, typesense, mailcatcher, minio]
Will start the given container. If no container is specified, all containers will be started.

bin/status

Usage: bin/status
Will list the status of all docker container in our environment.

bin/stop

Usage: bin/stop [web, api, router, redis, worker, postgres, elasticsearch, typesense, mailcatcher, minio]
Will stop the given container. If no container is specified, all containers will be stopped.