SHTK(1)

πŸ“¦
version 1.7 Β· 2 versions
, in nixos 26.05

πŸ’… SHTK(1) β€” like, the manual page for shtk (General Commands Manual, bestie)

okay so this is the manual page for shtk β€” welcome to the group chat πŸ’–


✨ NAME ✨

shtk β€” the interface to the Shell Toolkit, aka your new fave thing 🫢


🌸 SYNOPSIS 🌸

shtk build [-m main_function] [-o output_file] [-s shell] [input_file]
shtk version

πŸ¦‹ DESCRIPTION πŸ¦‹

The Shell Toolkit β€” shtk for short, iykyk β€” is a whole collection of modules written in sh(1) that hand you common functionality so writing complex shell scripts is, like, so much less of a nightmare. ✨

The tool described on this page is also named shtk, and it's a program that ships alongside the Shell Toolkit and gives you the functionality you might need to actually use the toolkit. Want the API docs? Go read shtk(3), bestie. πŸ“–

The interface of shtk is that of a program with commands, exactly like the synopsis shows. The subsections below describe the various commands the tool supports. πŸŽ€

πŸ› οΈ The build command β€” main character energy

The build command takes a script that uses shtk modules and generates an executable script with all the necessary boilerplate code so it can actually locate said modules. Slay. πŸ’…

The input_file argument is the path to the file to process. That file should end with an .sh extension, and if it does, build will just go ahead and generate a binary with the same name minus the extension. No extension? Then you must give the output file's name via the -o flag. Also, input_file can be -, and in that case the code gets read from standard input. 🧚

These are the options it supports:

  • -m main_function β€” the name of the function that implements the entry point of the program. For programs using the shkt_unittest(3) module, you should pass this as -m shtk_unittest_main.

Literally every script that uses shtk should implement a main function and should avoid putting any code at the top level of the file. The main function gets automatically executed by the generated script. If main_function is empty, then no call to main gets issued β€” which you might need if the script already calls main for whatever reason. πŸ™ˆ

Default: main.

  • -o output_file β€” path to the output file to generate.

Default: if input_file ends in .sh, the output file has the same name as the input file but without the extension. Otherwise this flag must be specified. (no cap, it's required)

  • -s shell β€” path to the shell interpreter to write in the shebang line of the file.

Default: /nix/store/hc49zakwkkyp9zlyl80b71jhxkpn4hsx-bash-5.3p9/bin/bash.

⭐ The version command β€” iconic, effortless

The version command prints the name of the package and its version to the standard output. This command always exits successfully. Like, always. It cannot fail. Queen behavior. πŸ‘‘


🌈 ENVIRONMENT 🌈

  • SHTK_MODULESDIR β€” overrides the built-in location of the modules.
  • SHTK_MODULESPATH β€” colon-separated list of directories in which to look for modules. SHTK_MODULESDIR is always implied at the end of the path. You can define this variable to point to other directories, and it's especially handy in packages that install custom modules and want to use such modules before installing them. πŸ’œ
  • SHTK_SHELL β€” overrides the built-in location of the default shell interpreter.

πŸ“ FILES πŸ“

  • /nix/store/risfks95a9rh0wddw5yr65c7xzcabf8j-shtk-1.7/share/shtk/ β€” location of the shtk modules. that's where they live 🏠

πŸ”₯ SEE ALSO πŸ”₯

  • shtk(3) β€” go read it, bestie, it's the whole API

πŸ‘‘ AUTHORS πŸ‘‘

The shtk package was developed by Julio Merino ⟨jmmv@google.com⟩. πŸ’–


and that's the whole page, no notes πŸ’…

okay bye, this one's from Debian, dated November 8, 2014 β€” that's the source, the version and the date all in one cute little sign-off, periodt. πŸŒΈπŸ¦‹βœ¨

πŸ“¦ where this page comes from
  • nixos 26.05: shtk 1.7
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms