Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/PrinceOfCookies/CookieOS/llms.txt

Use this file to discover all available pages before exploring further.

The list and ls commands replace the default CC:Tweaked directory listing with an enhanced version that shows the size of every file and directory inline, lays entries out horizontally across the terminal width, and exposes flags for total-size reporting and attribute inspection. Both commands accept the same arguments and produce the same output; they differ only in their internal implementation.

Basic usage

list [directory]
ls [directory]
If no directory is given, the current working directory is listed. Directories and files are displayed side-by-side across the screen, wrapping to the next line when the terminal width would be exceeded.
  • Directories are shown in green on an Advanced Computer, or light-gray on a Standard Computer.
  • Files are shown in white on both computer types.
  • Each entry includes its size in parentheses: e.g. startup (1.23 KB), loading.lua (456 B).
  • Read-only entries are wrapped with a · prefix and suffix (middle dot, \xB7): e.g. ·rom· (12.00 KB).
  • Hidden files — those whose names begin with . — are not shown by default. Enable them with the list.show_hidden setting (see the note below).

Flags

FlagDescription
-sDisplay the total recursive size of all files in the current directory
-iDisplay fs.attributes2 attributes for the current directory
-hDisplay help text
<directory> -iDisplay fs.attributes2 attributes for a specific directory

Examples

-- Basic listing of the current directory
list

-- List a specific directory
list startup

-- Show the total size of all files in the current directory
list -s
-- Output: Total size: 48.72 KB

-- Show attributes for a specific directory
list os -i
-- Output:
-- Attributes of os
-- {
--   size = "12.34 KB",
--   modified = "1 day, 2 hrs",
--   created = "3 weeks, 0 days",
--   isDir = true,
--   isReadOnly = false,
-- }

-- Show help
list -h
-- Output:
-- Usage: list [-s] [-i] [-h] [directory], list <directory> [-i]
--   -s: Display the total size of all files in the current directory
--   <directory> -i: Display the attributes of the directory
--   -h: Display this help message

list vs ls

The two commands are functionally identical from the user’s perspective. Internally:
  • list (programReplacements/list.lua) contains its own local getDirectorySize and formatSize helpers and also loads any aliases found inside subdirectories of /programReplacements/.
  • ls (programReplacements/ls.lua) delegates to cosUtils.getFilesAndDirs() and cosUtils.formatSize() from the global cosUtils API instead of using local copies.
Both commands register a tab-completion handler via cc.shell.completion so that directory names are completed automatically when you press Tab.

Hidden files

Hidden files (names starting with .) are not listed by default. To show them, set the list.show_hidden setting:
-- Show hidden files
settings.set("list.show_hidden", true)
settings.save()  -- persist across reboots

-- Hide them again (default)
settings.set("list.show_hidden", false)

Build docs developers (and LLMs) love