Sci-Tech Electronic Assistant for Coding Campers
A utility for starting projects and managing files on shared computers at URJ 6 Points Sci-Tech Academy.
UPDATED FOR 2025: Now for the Python workshop, although this tool still uses JS (since I didn't have time to rewrite it all).
npm i -g @marcstober/steacc
st
Prompt for coder name and project, and switch to folder.
st update
Update S.T.E.A.C.C. st up also works.
st backup
Backup to Google Drive.
st version
Get the version number.
st hello
I wonder what this does?
st help
Display usage information.
st surprise
Run a surprise script. The surprise script can be configured with st cs <zipfile>. The actual surprise is not distributed with the package
because that would ruin the surprise and, also, it may contain
material that I can't share publicly.
This means users can:
- Use steacc
cs surprise.zipto install a custom surprise package. - The zip should contain a
surprise.ps1file that will be extracted to~/.steacc/surprise/. - From then on,
steacc surprisewill run their custom surprise instead of the built-in one.
- Enhancements to terminal tutorial, including using Markdown and Marked for nicely formatted text.
- Prevent UI from displaying "undefined" at beginning of backup.
- Add progress tracking to
st backup! - Removed deprecated
uploadsubcommand that did the exact same things asbackup. - Add Python extension installation to
st winget.
- Add learn command and terminal tutorial, and run as part of onboarding.
- Restore (and reduce tech debt relating to) wrapper script, the lack of which caused a regression in that changing directories did not function.
- Show an error, rather than defaulting to the no-args functionality, if an invalid command arg is given. (This especially
helps when users call
st supriseinstead ofst surprise.) - Add a hidden
st cs <zipfile>feature to configure the surprise.'
- Surprise feature.
- Spash screen and onboarding updates.
- Remove dependency on ascii-art because of error in installing (because of lack of prebuilt binaries) in node > 20.
- st backup: Start uploading without user needing to "Click to continue", and redirect browser to the actual Google Drive folder we uploaded to when done.
- Install everything for the workshop. (See install-proco-apps.ps1 elsewhere, cf. winget-install.ps1) - BUT some things are not public and this is an open-source package?
- It would be nice if this pull request was merged: mikaelbr/marked-terminal#367
- (Lower priority as of 2025) Install p5.vscode (or, a replacement/update for it)
- 4 spaces
- no semicolons
- install P5 and P5.sound via NPM instead?
- Install p5play (via NPM)
- Install p5play VSCode extension?
- Uploader
- Unit test including that all files are uploaded in the correct folder structure
- Refactor, convert to EJS module
- progress bar in the browser before redirecting to Google
ascii-arthas been replaced with our ownaaartPython package, but some functionality fromascii-artand maybe evenfigletshould still be ported over.- Onboarding Experience
- ASCII art - add an image?
- Rules, etc. - make them look nicer?
- Add a command to open the "web board"? (Might have some set-up function so we don't hard-code this URL into github.)
- 2025: Replacing this with a folder with a bit.ly link, so I'm not sure this is quite so useful.
- Make question-asker it's own published npm package? Might be overkill?
Ensure the full functionality of changing to a project directory works.
Ensure that uninstalling with npm uninstall -g cleans up the bin file (steacc_, steacc, st)
To use this tool with your own Google account or organization, you must create a Google Cloud project and configure OAuth credentials:
- Go to Google Cloud Console.
- Click the project dropdown (top left) and select New Project.
- Give your project a name and create it.
- In your project, go to APIs & Services > Library.
- Search for Google Drive API and click Enable.
- Go to APIs & Services > OAuth consent screen.
- Choose External or Internal (depending on your needs).
- Fill out the required fields (app name, support email, etc.).
- Add scopes:
https://www.googleapis.com/auth/drive.filehttps://www.googleapis.com/auth/drive.metadata.readonly
- Add test users (your Google account email).
- Go to APIs & Services > Credentials.
- Click Create Credentials > OAuth client ID.
- Choose Web application.
- Set Authorized redirect URIs to:
http://localhost:3000/oauth2callback
- Download the credentials JSON file and save it as
oauth2.keys.jsonin your project directory.
- Replace the
clientIdin your code with the one from your credentials file, or load it from the JSON. - Make sure your code points to the correct credentials file.
- Add their emails as test users in the OAuth consent screen if the app is not published.
Tip:
Keep your credentials file (oauth2.keys.json) secure and never commit it to public repositories.
Summary Table for README:
| Step | Where | What to do |
|---|---|---|
| 1 | Google Cloud Console | Create a project |
| 2 | APIs & Services > Library | Enable Google Drive API |
| 3 | APIs & Services > OAuth consent screen | Configure consent screen & add scopes |
| 4 | APIs & Services > Credentials | Create OAuth client ID, set redirect URI, download JSON |
| 5 | Your project | Place JSON as oauth2.keys.json and update code if needed |
This section was written by Copilot.
To support the directory-changing functionality,
st or steacc actually are PowerShell scripts
that wrap steacc_ which is not intended to be called
directly.
I looked for an NPM package that would allow synchronous (i.e., blocking) user
input in the terminal so that learners could write simple programs that ask questions to the user without first having to learn about promises or callback functions (or even how to write functions yet at all, for that matter).
Like the old input command in BASIC. I didn't find anything that quite
met my needs and seemed to be in line with the state of the art for JavaScript
in 2024.
Some other requirements I wanted to fullfill are:
- That the synchronous be called with
await, because that's what you usually have to do to call a synchronous function in modern JavaScript, so I wanted to teach it that way, and it's an appropriate gentle introduction to synchronous JavaScript (even if the complexities of why this is needed or how it relates to promises is too advanced at this point) to simply explain, "you use await when you want the computer to wait for something." - A simple "one liner" to invoke the prompt, and minimal boilerplate code.
(The built-in
readlinemodule requires too much boilerplate; essentially I'm just wrapping that up in a module.) - Based on Node's built-in readline module, because there's no need to complicate this further.
- ESM module, because it's 2024.
Some NPM packages do similar things but don't meet these requirements:
- readline-sync: no longer maintained, not ESM.
- inquirer: too complicated and very "heavy" (installs lots of dependencies) for what I need.
- picoprompt: almost what I want, but doesn't use
await, and on further inspect has a complex internal implementation.
I thought about publishing this as a package on its own, but any experienced
programmer should be able to write the few extra lines of boilerplate
required to use readline themselves rather than need a dependency.
Steak ASCII art based on: Image by Raquel Candia from Pixabay