/bash-example v2
@echo off
REM Usage: todo Your todo text here
REM Sends POST { "text": "<args>" } to the API and prints the output.
setlocal EnableExtensions EnableDelayedExpansion
REM If no arguments -> exit
if "%~1"=="" (
echo No text provided. Nothing to send.
exit /b 0
)
REM Concatenate all arguments into one string
set "TEXT=%*"
REM If you need UTF-8 for special characters, uncomment:
REM chcp 65001 >nul
curl.exe -s -X POST "https://todo-api.leanderziehm.com/texts" ^
-H "accept: application/json" ^
-H "Content-Type: application/json" ^
-d "{\"text\":\"%TEXT%\"}"
echo.
endlocal