Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ jobs:

- name: Make target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
run: mkdir -p catscript/.js/target catscript/.native/target catscript/.jvm/target project/target
run: mkdir -p gatos/.native/target gatos/.js/target gatos/.jvm/target project/target

- name: Compress target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
run: tar cf targets.tar catscript/.js/target catscript/.native/target catscript/.jvm/target project/target
run: tar cf targets.tar gatos/.native/target gatos/.js/target gatos/.jvm/target project/target

- name: Upload target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
Expand Down Expand Up @@ -244,7 +244,7 @@ jobs:
- name: Submit Dependencies
uses: scalacenter/sbt-dependency-submission@v2
with:
modules-ignore: catscript-examples_2.13 catscript-examples_3 rootjs_2.13 rootjs_3 docs_2.13 docs_3 rootjvm_2.13 rootjvm_3 rootnative_2.13 rootnative_3
modules-ignore: gatos-examples_2.13 gatos-examples_3 rootjs_2.13 rootjs_3 docs_2.13 docs_3 rootjvm_2.13 rootjvm_3 rootnative_2.13 rootnative_3
configs-ignore: test scala-tool scala-doc-tool test-internal

site:
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Catscript 😸
# GatOS 😸
### _Making scripts in Scala much easier!_
![Continuous Integration](https://github.com/typelevel/catscript/workflows/Continuous%20Integration/badge.svg)
![Continuous Integration](https://github.com/typelevel/gatos/workflows/Continuous%20Integration/badge.svg)

## Overview
Catscript is a library for working with files (and soon processes) using pure [`IO`](https://typelevel.org/cats-effect/docs/getting-started), designed to make things much easier.
GatOS (that's Spanish for Cats!) is a library for working with files (and soon processes) using pure [`IO`](https://typelevel.org/cats-effect/docs/getting-started), designed to make things much easier.

**Before**
```scala 3
Expand All @@ -23,29 +23,29 @@ It does this by drastically reducing the complexity of the `Files' API and getti

## Getting Started

You can use Catscript in a new or existing Scala 2.13.x or 3.x project by adding it to your `build.sbt` file:
You can use GatOS in a new or existing Scala 2.13.x or 3.x project by adding it to your `build.sbt` file:

```scala
libraryDependencies ++= List(
"org.typelevel" %% "catscript" % latest
"org.typelevel" %% "gatos" % latest
)
```

## Example
Catscript is a library to perform common script operations such as working with processes and files while maintaining referential transparency!
GatOS is a library to perform common script operations such as working with processes and files while maintaining referential transparency!

```scala 3 mdoc:reset
import cats.effect.{IO, IOApp, ExitCode}

import catscript.*
import catscript.syntax.path.*
import gatos.*
import gatos.syntax.path.*
Comment on lines +40 to +41
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mdoc example imports gatos.* / gatos.syntax.path.*, but there is no top-level gatos package in this repo (library code is under org.typelevel.gatos). This will make the snippet fail to compile during docs/README generation; switch to fully-qualified imports (e.g., org.typelevel.gatos...) or add an explicit import org.typelevel.gatos alias before using the gatos prefix.

Suggested change
import gatos.*
import gatos.syntax.path.*
import org.typelevel.gatos.*
import org.typelevel.gatos.syntax.path.*

Copilot uses AI. Check for mistakes.

object Main extends IOApp:

def run(args: List[String]): IO[ExitCode] =
for
home <- userHome
config = home / ".catscript" / "config.conf"
config = home / ".gatos" / "config.conf"
_ <- config.createFile
_ <- config.write("scripting.made.easy = true")
newconfig <- config.read
Expand Down
14 changes: 7 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("17"))

ThisBuild / crossScalaVersions := Seq("2.13.18", "3.3.7")

lazy val root = tlCrossRootProject.aggregate(catscript, examples)
lazy val root = tlCrossRootProject.aggregate(gatos, examples)

lazy val catscript = crossProject(JVMPlatform, JSPlatform, NativePlatform)
lazy val gatos = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.crossType(CrossType.Pure)
.in(file("catscript"))
.in(file("gatos"))
.settings(
name := "catscript",
name := "gatos",
libraryDependencies ++= List(
"org.typelevel" %% "cats-core" % "2.13.0",
"org.typelevel" %% "cats-effect" % "3.7.0",
Expand All @@ -41,16 +41,16 @@ lazy val catscript = crossProject(JVMPlatform, JSPlatform, NativePlatform)
lazy val examples = project
.in(file("examples"))
.enablePlugins(NoPublishPlugin)
.dependsOn(catscript.jvm)
.dependsOn(gatos.jvm)
.settings(
name := "catscript-examples",
name := "gatos-examples",
Compile / run / fork := true
)

lazy val docs = project
.in(file("site"))
.enablePlugins(TypelevelSitePlugin)
.dependsOn(catscript.jvm)
.dependsOn(gatos.jvm)
.settings(
libraryDependencies += "co.fs2" %% "fs2-scodec" % "3.13.0",
laikaConfig := LaikaConfig.defaults
Expand Down
30 changes: 15 additions & 15 deletions docs/examples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ import cats.effect.{IO, IOApp}

import fs2.io.file.Path

Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These mdoc examples import gatos.syntax.path.*, but there is no top-level gatos package; the syntax package is org.typelevel.gatos.syntax.path. With mdoc/mdoc:reset this will not compile unless you first import org.typelevel.gatos to create the gatos alias (as done in some other docs pages).

Suggested change
import org.typelevel.gatos

Copilot uses AI. Check for mistakes.
import catscript.syntax.path.*
import gatos.syntax.path.*

object Scores extends IOApp.Simple:

Expand Down Expand Up @@ -105,7 +105,7 @@ import cats.effect.{IO, IOApp}

import fs2.io.file.Path

import catscript.Catscript
import gatos.Gatos
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mdoc:reset block imports gatos.Gatos, but the Gatos object is defined in package org.typelevel.gatos. Unless you explicitly import org.typelevel.gatos first (to introduce gatos as an alias), this import won’t resolve; prefer import org.typelevel.gatos.Gatos (or import org.typelevel.gatos then gatos.Gatos).

Suggested change
import gatos.Gatos
import org.typelevel.gatos.Gatos

Copilot uses AI. Check for mistakes.

object Scores extends IOApp.Simple:

Expand All @@ -123,10 +123,10 @@ object Scores extends IOApp.Simple:

def run: IO[Unit] =
for
lines <- Catscript.readLines(path)
lines <- Gatos.readLines(path)
scores <- lines.traverse(parseScore(_).liftTo[IO])
_ <- IO(scores.foreach(score => println(score.show)))
_ <- Catscript.appendLine(path, Score("daniela", 100).show)
_ <- Gatos.appendLine(path, Score("daniela", 100).show)
yield ()

end Scores
Expand Down Expand Up @@ -206,7 +206,7 @@ Here, the complete script:
import cats.effect.{IO, IOApp}
import fs2.io.file.Path

import catscript.syntax.path.*
import gatos.syntax.path.*
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mdoc example uses import gatos.syntax.path.*, but gatos isn’t a top-level package in this repo; the syntax package is under org.typelevel.gatos.syntax.path. With mdoc:reset this block won’t compile unless you first introduce gatos via import org.typelevel.gatos (or just use fully-qualified imports).

Suggested change
import gatos.syntax.path.*
import org.typelevel.gatos.syntax.path.*

Copilot uses AI. Check for mistakes.

object Uppercase extends IOApp.Simple:

Expand All @@ -228,7 +228,7 @@ end Uppercase
import cats.effect.{IO, IOApp}
import fs2.io.file.Path

import catscript.syntax.Catscript
import gatos.syntax.Gatos
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import gatos.syntax.Gatos doesn’t match the project’s package layout (there’s no syntax.Gatos), so this snippet should not compile. Update the import to refer to the actual Gatos object under org.typelevel.gatos (or add the org.typelevel.gatos alias and then import/use gatos.Gatos).

Suggested change
import gatos.syntax.Gatos
import org.typelevel.gatos.Gatos

Copilot uses AI. Check for mistakes.

object Uppercase extends IOApp.Simple:

Expand All @@ -237,8 +237,8 @@ object Uppercase extends IOApp.Simple:

def run: IO[Unit] =
for
file <- Catscript.read(path)
_ <- Catscript.write(upperPath, file.toUpperCase)
file <- Gatos.read(path)
_ <- Gatos.write(upperPath, file.toUpperCase)
yield ()

end Uppercase
Expand Down Expand Up @@ -270,7 +270,7 @@ end Uppercase

## Places

Catscript can handle binary files in custom binary formats since it includes [scodec](https://scodec.org/). In this example, we are going to create a binary file with a list of places.
GatOS can handle binary files in custom binary formats since it includes [scodec](https://scodec.org/). In this example, we are going to create a binary file with a list of places.

We start by defining type representations of the data we are going to work with:

Expand Down Expand Up @@ -326,7 +326,7 @@ import fs2.io.file.Path
import scodec.codecs.*
import scodec.Codec

import catscript.syntax.path.*
import gatos.syntax.path.*
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue here: import gatos.syntax.path.* relies on a gatos package that doesn’t exist at the root. To keep the mdoc snippet compiling, switch to org.typelevel.gatos.syntax.path.* or add import org.typelevel.gatos before using the gatos prefix.

Suggested change
import gatos.syntax.path.*
import org.typelevel.gatos.syntax.path.*

Copilot uses AI. Check for mistakes.

object Place extends IOApp.Simple:

Expand Down Expand Up @@ -358,7 +358,7 @@ import fs2.io.file.Path
import scodec.codecs.*
import scodec.Codec

import catscript.syntax.Catscript
import gatos.syntax.Gatos
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import gatos.syntax.Gatos is not a valid import for this project (no syntax.Gatos exists). Update this snippet to import the Gatos object from its actual package (org.typelevel.gatos) or introduce the gatos alias explicitly before importing.

Suggested change
import gatos.syntax.Gatos
import org.typelevel.gatos.Gatos

Copilot uses AI. Check for mistakes.

object Place extends IOApp.Simple:

Expand All @@ -368,11 +368,11 @@ object Place extends IOApp.Simple:

def run: IO[Unit] =
for
exists <- Catscript.exists(path)
exists <- Gatos.exists(path)
// Equivalent of doing `if (exists) IO.unit else path.createFile`
_ <- Catscript.createFile(path).unlessA(exists)
_ <- Catscript.writeAs[Place](path, Place(1, "Michael Phelps"))
place <- Catscript.readAs[Place](path)
_ <- Gatos.createFile(path).unlessA(exists)
_ <- Gatos.writeAs[Place](path, Place(1, "Michael Phelps"))
place <- Gatos.readAs[Place](path)
_ <- IO.println(place)
yield ()

Expand Down
12 changes: 6 additions & 6 deletions docs/examples/solutions.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This section offers possible solutions to the documentation's exercises. Refer t
```scala mdoc:compile-only
import cats.effect.{IO, IOApp}
import fs2.io.file.Path
import org.typelevel.catscript.syntax.path.*
import org.typelevel.gatos.syntax.path.*

object ReadingSolution extends IOApp.Simple:

Expand All @@ -28,7 +28,7 @@ end ReadingSolution
```scala mdoc:compile-only
import cats.effect.{IO, IOApp}
import fs2.io.file.Path
import org.typelevel.catscript.syntax.path.*
import org.typelevel.gatos.syntax.path.*

object WritingSolution extends IOApp.Simple:

Expand All @@ -50,7 +50,7 @@ end WritingSolution
```scala mdoc:compile-only
import cats.effect.{IO, IOApp}
import fs2.io.file.Path
import org.typelevel.catscript.syntax.path.*
import org.typelevel.gatos.syntax.path.*

object LinesSolution extends IOApp.Simple:

Expand All @@ -72,7 +72,7 @@ end LinesSolution
```scala mdoc:compile-only
import cats.effect.IO
import fs2.io.file.Path
import org.typelevel.catscript.syntax.path.*
import org.typelevel.gatos.syntax.path.*

extension (path: Path)
def createFileAndDirectories: IO[Unit] =
Expand All @@ -88,7 +88,7 @@ extension (path: Path)
import cats.syntax.all.*
import cats.effect.IO
import fs2.io.file.Path
import org.typelevel.catscript.syntax.path.*
import org.typelevel.gatos.syntax.path.*

extension (path: Path)
def deleteIfChubby(threshold: Long): IO[Boolean] =
Expand All @@ -104,7 +104,7 @@ extension (path: Path)
```scala mdoc:compile-only
import cats.effect.{IO, Resource}
import fs2.io.file.Path
import org.typelevel.catscript.syntax.path.*
import org.typelevel.gatos.syntax.path.*

def makeTempFile: Resource[IO, Path] =
Resource.make(createTempFile)(p => p.deleteIfExists.void)
Expand Down
14 changes: 7 additions & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
# Catscript 😸
# GatOS 😸
**Making scripts in pure Scala much easier!**

## Getting Started

You can use Catscript in a new or existing Scala 2.13.x or 3.x project by adding it to your `build.sbt` file:
You can use GatOS in a new or existing Scala 2.13.x or 3.x project by adding it to your `build.sbt` file:

```scala
libraryDependencies ++= Seq(
"org.typelevel" %% "catscript" % "@VERSION@"
"org.typelevel" %% "gatos" % "@VERSION@"
)
```

## Example
Catscript is a library to perform common script operations such as working with processes and files while maintaining referential transparency!
GatOS is a library to perform common script operations such as working with processes and files while maintaining referential transparency!

```scala 3 mdoc:reset
import cats.effect.{IO, IOApp, ExitCode}

import catscript.*
import catscript.syntax.path.*
import gatos.*
import gatos.syntax.path.*
Comment on lines +20 to +21
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mdoc snippet imports gatos.* / gatos.syntax.path.*, but the codebase does not define a top-level gatos package (the API lives under org.typelevel.gatos). As written, the example should not compile when the site is built; use fully-qualified imports or import org.typelevel.gatos first so gatos is available as an alias.

Suggested change
import gatos.*
import gatos.syntax.path.*
import org.typelevel.gatos.*
import org.typelevel.gatos.syntax.path.*

Copilot uses AI. Check for mistakes.

object Main extends IOApp:

def run(args: List[String]): IO[ExitCode] =
for
home <- userHome
config = home / ".catscript" / "config.conf"
config = home / ".gatos" / "config.conf"
_ <- config.createFile
_ <- config.write("scripting.made.easy = true")
newconfig <- config.read
Expand Down
22 changes: 11 additions & 11 deletions docs/introduction/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

## Which API should I use?

In Catscript, you have two different ways of doing things:
In GatOS, you have two different ways of doing things:

- First, if you prefer a more concise syntax, use the extension methods (e.g. `path.read()`) by importing the `catscript.syntax.path.*` package.
- First, if you prefer a more concise syntax, use the extension methods (e.g. `path.read()`) by importing the `gatos.syntax.path.*` package.

- If you prefer calling static methods, use direct method calls on the `Catscript` object (e.g., `Catscript.read(path)`). You can also import all the functions inside the `catscript.Catscript` package if you don't want to call the `Catscript` object every time (e.g., `read(path)`).
- If you prefer calling static methods, use direct method calls on the `Gatos` object (e.g., `Gatos.read(path)`). You can also import all the functions inside the `gatos.Gatos` package if you don't want to call the `Gatos` object every time (e.g., `read(path)`).

In this documentation we'll call the methods on the `Catscript` objects in the static variant to differentiate them from the extension ones.
In this documentation we'll call the methods on the `Gatos` objects in the static variant to differentiate them from the extension ones.

@:select(api-style)

@:choice(syntax)

```scala 3
import catscript.syntax.all.*
import gatos.syntax.all.*

val path = Path("data/test.txt")
Comment on lines 17 to 20
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gatos.syntax.all.* is referenced here, but the codebase only defines org.typelevel.gatos.syntax.path (there’s no syntax.all package/object). This makes the documentation example incorrect; update it to import the actual syntax package (and Path if needed) that users should use.

Copilot uses AI. Check for mistakes.

Expand All @@ -28,13 +28,13 @@ yield ()
@:choice(static)

```scala 3
import catscript.Catscript
import gatos.Gatos

val path = Path("data/test.txt")
Comment on lines 30 to 33
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This static example imports gatos.Gatos, but Gatos is in org.typelevel.gatos. Unless you first import org.typelevel.gatos to introduce gatos as an alias, this import is invalid; use the fully-qualified package path (or add the alias import) so the snippet is copy/pasteable.

Copilot uses AI. Check for mistakes.

for
file <- Catscript.read(path)
_ <- Catscript.append(path, "I'll place this here.")
file <- Gatos.read(path)
_ <- Gatos.append(path, "I'll place this here.")
yield ()
```

Expand All @@ -44,11 +44,11 @@ Which one you should use really depends on your preferences and choices; if you

## Imports

If you just want to start scripting right away, importing `catscript.*` will do the trick; it imports all the extension methods and functionality you need, such as types and functions, to start working right away.
If you just want to start scripting right away, importing `gatos.*` will do the trick; it imports all the extension methods and functionality you need, such as types and functions, to start working right away.

But if you want more concise functionality, the `catscript.syntax.path.*` will only import the extension methods.
But if you want more concise functionality, the `gatos.syntax.path.*` will only import the extension methods.

For the static methods, the `catscript.Catscript` will provide the functions to work with files, if that is your preferred style.
For the static methods, the `gatos.Gatos` will provide the functions to work with files, if that is your preferred style.
Comment on lines 45 to +51
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section says users can import gatos.*, but the repository doesn’t define a top-level gatos package to import from (the API is under org.typelevel.gatos, and methods like userHome live on the Gatos object / in syntax.path). Update the documentation to show the correct imports users need for each style.

Copilot uses AI. Check for mistakes.


## Talking about computations
Expand Down
Loading